bugfix> django > 投稿

私のコードは次のとおりです。

holidayRequest.py

from django.db import models
from enum import Enum
class HolidayRequests(models.Model):
    class Meta:
        db_table = 'holidays_requests'
        app_label = 'dashboard'
    name = models.CharField(max_length = 255,null= False)
    email = models.CharField(max_length = 255,null=False)
    ph_no = models.CharField(max_length =255,null=False)

    holiday = models.ForeignKey('holidays',on_delete=models.CASCADE)

holiday.py

from django.db import models
from enum import Enum
class Holiday (models.Model):
    class Meta:
        db_table = 'holidays'
        app_label = 'dashboard'
    holiday_price  = models.CharField(max_length = 255,null =False)
    holiday_title = models.CharField(max_length=255,null=False)

init.py (モデルフォルダー内)

from holidayRequest import HolidayRequests
from holiday import Holiday

移行を実行すると、次のエラーが表示されます。

dashboard.HolidayRequests.holiday: (fields.E300) Field defines a relation with model 'holidays', which is either not installed, or is abstract.
dashboard.HolidayRequests.holiday: (fields.E307) The field dashboard.HolidayRequests.holiday was declared with a lazy reference to 'dashboard.holidays', but app 'dashboard' doesn't provide model 'holidays'.