简体   繁体   中英

Integrate current models from models.Model to BaseModel django

I've some models from models.Model in django and wish to know if I change it and extend to BaseModel will occur some error when I make migrations. Thanks

否。如果您的BaseModel扩展了models.Model

If BaseModel is abstract, then changing a model to inherit from models.Model to BaseModel will not require a migration.

If BaseModel is not abstract, then you are switching to multi-table inheritance, and migrations will be required.

See the Django docs on inheritance for more info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM