What is abstract attribute in a Django model?
What's the purpose to define a Django
model with abstr开发者_如何学JAVAact = True
?
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.
精彩评论