db.models.Field.db_column

Field.db_column

The name of the database column to use for this field. If this isn’t given, Django will use the field’s name.

If your database column name is an SQL reserved word, or contains characters that aren’t allowed in Python variable names – notably, the hyphen – that’s OK. Django quotes column and table names behind the scenes.

doc_Django
2016-10-09 18:35:22
Comments
Leave a Comment

Please login to continue.