import error when cross importing django/python
Question: Hi all can anyone help me with this I am having import error when I do an
import I think its all clashing.all was fine till I imported B because I
really need to make a ForeignKey to B from A.

a/models.py

    
    
    from b.models import B #there is the problem
    Class A():
        ....
        b = models.ForeignKey(B) # I really have to do this
    

b/models.py

    
    
    from c.models import C
    
    Class B():
        ....
        c = models.ForeignKey(C)
    

c/models.py

    
    
    from a.models import A
    Class C():
        a = models.ForeignKey(A)
    


Answer: You can do this (not import model B, just type a string in format
"app_name.model_name")

a/models.py

    
    
    Class A():
        ....
        b = models.ForeignKey("b.B")
    

[ForeignKey
docs](https://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey)

