Table A.3 is a complete list of model meta options you can give your model in its internal class Meta
. For more detail on each meta option as well as examples, see the Django documentation at https://docs.djangoproject.com/en/1.8/ref/models/options/.
Option |
Notes |
---|---|
|
If |
|
If a model is defined outside of an application in |
|
The name of the database table to use for the model. |
|
The name of the database tablespace to use for this model. The default is the project's |
|
The name that will be used by default for the relation from a related object back to this one. The default is |
|
The name of an orderable field in the model, typically a |
|
Defaults to |
|
Marks this object as orderable with respect to the given field. |
|
The default ordering for the object, for use when obtaining lists of objects. |
|
Extra permissions to enter into the permissions table when creating this object. |
|
Defaults to |
|
If |
|
Determines if Django will use the pre-1.6 |
|
Sets of field names that, taken together, must be unique. |
|
Sets of field names that, taken together, are indexed. |
|
A human-readable name for the object, singular. |
|
The plural name for the object. |
Table A.3: Model metadata options