InvalidBasesError: Cannot resolve bases for []

后端 未结 14 952
遥遥无期
遥遥无期 2021-02-03 23:03

When I run tests I get this error during database initialization:

django.db.migrations.state.InvalidBasesError: Cannot resolve bases for [

        
相关标签:
14条回答
  • 2021-02-03 23:52

    I've come across this issue, and as commenting out the model isn't really a solution, I've found that setting the undocumented auto_created = True to the Meta class will make Django ignore it.

    class GroupProxy(Group):
    
        class Meta:
            proxy = True
            auto_created = True
    
    0 讨论(0)
  • 2021-02-03 23:52

    I faced the same issue and adding app_label attribute in class Meta: solved the error :

    class GroupProxy(Group):
        class Meta:
            proxy = True
            app_label = '<app in which you want this model>'
            verbose_name = Group._meta.verbose_name
            verbose_name_plural = Group._meta.verbose_name_plural
    
    0 讨论(0)
提交回复
热议问题