L
L
Lopus2018-12-14 15:50:02
Django
Lopus, 2018-12-14 15:50:02

How to solve recursive model import problem in django?

You need to create a ForeignKey connection.
I'm importing a model from application 1 of application 2. But application 2 already imports some models from application 1.
make migrations throws an error when adding an import line to application 1.
What should I do in this case?
django 1.9

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Shatalov, 2018-12-14
@netpastor

field = models.ForeignKey('app1.Model')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question