In my Django model, I want to use the text choices from another model, but I don't want to use it as a foreign key, because I want the whole list of weekdays before any Day object exists.
If I use it as a foreign key, I will need to create Day object first.
Can anyone help to solve this?
class Day(models.Model):
class Weekdays(models.TextChoices):
MONDAY = "Monday"
TUESDAY = "Tuesday"
WEDNESDAY = "Wednesday"
THURSDAY = "Thursday"
FRIDAY = "Friday"
SATURDAY = "Saturday"
SUNDAY = "Sunday"
store = models.ForeignKey(Store, on_delete=models.DO_NOTHING)
weekday = models.CharField(max_length=9, choices=Weekdays.choices)
class School(models.Model):
weekday = ???