2
The relationship between the classes in the Models.py file does not work because of the order of the classes (I think it has more to do with the interpreter) follows the problem:
class Producao(models.Model):
empresa= models.OneToOneField(Empresa,null=False,blank=False,on_delete= models.PROTECT)
class Assinatura(models.Model):
producoes= models.ManyToManyField(Producao,blank=False)
class Empresa(models.Model):
assinatura=models.ManyToManyField(Assinatura, blank=True)
In the case of the variable empresa
is giving error because for it the Company class does not exist, only that if I put the company class before the Production class the variable producoes
It starts to get messy, and no matter how I organize it, it’s always gonna get messy because one depends on the other. How do I get the mapping fucionar?