[Answered ]-Django manytomany field failing with "relation does not exist" due to model being in separate app. Change order of app creation?

2👍

Check for, and resolve, any circular imports. This is when one models.py imports from another which also imports from the original. For example, App Report imports models from Notes, but Notes also imports from Report. The only way to change the order of creation, is to change the order of the INSTALLED_APPS and the order in which they are in the models.py files. As jpic said, you can reference the M2M reference object with quotes and the app name dot model name, like:

class Report(models.Model):
    .
    .
    .
    whatevers = ManyToManyField('Notes.whatever_model')
    .
    .
    .

Leave a comment