Model metadata options

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

abstract

If abstract = True, this model will be an abstract base class.

app_label

If a model is defined outside of an application in INSTALLED_APPS, it must declare which app it belongs to.

db_table

The name of the database table to use for the model.

db_tablespace

The name of the database tablespace to use for this model. The default is the project's DEFAULT_TABLESPACE setting, if set. If the backend doesn't support tablespaces, this option ...

Get Mastering Django: Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.