Abstract classes such as AbstractProduct which inherit from third party package model_utils.InheritanceManage, will not work with abstract attribute specified true:

For this reason, its subclass like ProductA will cause create issue when load fixtures data by running this command:

Which will not raise errors also not writing into database, see the same issue on stackoverflow

The solution here is provide post_save signal and execute save(), because loaddata command will not call pre_save() and save()

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。