Django: Why do some model fields clash with each other?

后端 未结 6 2300
南笙
南笙 2020-11-29 16:10

I want to create an object that contains 2 links to Users. For example:

class GameClaim(models.Model):
    target = models.ForeignKey(User)
    claimer = mod         


        
6条回答
  •  一整个雨季
    2020-11-29 16:50

    Just adding to Jordan's answer (thanks for the tip Jordan) it can also happen if you import the level above the apps and then import the apps e.g.

    myproject/ apps/ foo_app/ bar_app/

    So if you are importing apps, foo_app and bar_app then you could get this issue. I had apps, foo_app and bar_app all listed in settings.INSTALLED_APPS

    And you want to avoid importing apps anyway, because then you have the same app installed in 2 different namespaces

    apps.foo_app and foo_app

提交回复
热议问题