Alireza Savand
Alireza Savand

Reputation: 3488

What is abstract attribute in a Django model?

What's the purpose to define a Django model with abstract = True ?

Upvotes: 0

Views: 687

Answers (1)

lcltj
lcltj

Reputation: 1598

abstract=True means this model is an abstract model class. It does not have a database table and is merely a shared parent model class so that the child models don't need to rewrite all the fields. Each child models will have their own table.

abstract=False means a normal model, django will create a table for it.

Upvotes: 4

Related Questions