开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜