2π
β
If I understand your code organization correctly, the problem is in your imports. When you say
from . import Role
youβre importing Role.py
into a module object named Role
. Inside that module (I assume) is your Role
model class. So what you really want is:
from .Role import Role
Or:
from . import Role
...
role_id = models.OneToOneField(Role.Role)
0π
You should define an app_label
in your meta class
class Foo(models.Model):
class Meta:
app_label = 'mainws'
π€DRC
- [Answered ]-In Django, how to populate a generic relation from a single form field?
- [Answered ]-Django β Filter by distinct fields of a model class
- [Answered ]-Purpose of ugettext inside of Models
- [Answered ]-Regex to match combination of letter and numbers to be used in URL pattarns in Django Project?
- [Answered ]-Django Static Inlines
Source:stackexchange.com