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.