I have 2 apps named social
and instagram
. The structure of models.py
file is as follows :
In social app :
from instagram.models import User as instagramUser
class User(models.Model):
# some fields
class Meta:
abstract = True
class Foo(models.Model):
# Some fields
def save(self, *args, **kwargs):
# some validation on User models from instagram app (instagramUser)
super(Foo, self).save(*args, **kwargs)
and in instagram app :
from social.models import User as socialUser
class User(socialUser):
# Some additional fields
Conceptually this structure is correct and the model Foo should be located in social app. But as expected when running circular dependency occurs. I want to keep conceptual correctness while resolving the circular dependency. How can I do that?