我有2个应用程序安装在我的Django项目"aplikacja"
第一个名字是:"哥吉娜"
from django.db import models
class Godzina (models.Model):
GODZINA = (
('19', '19'),
('20', '20'),
('21', '21'),
)
godzina = models.CharField(max_length=6, choices=GODZINA, verbose_name='jezyk')
第二个命名为:"UserProfile"
from django.db import models
from django.contrib.auth.models import User
from godzina.models import Godzina
class UserProfile(models.Model):
czas = models.ForeignKey('Godzina')
user = models.OneToOneField(User)
我犯了这样的错误:
userprofile.UserProfile.czas: (fields.E300) Field defines a relation with model 'Godzina', which is either not installed, or is abstract.
什么意思?我希望用户只能 Select 管理员在应用程序"Godzina"中输入的时间,例如,我定义的时间是下午19:20,然后用户可以在UserProfile应用程序中 Select 这些值
有可能解决这个问题吗?