1๐
I would propose something like this:
DAY_CHOICES = (
('01', 'Sunday'),
('02', 'Monday'),
# etc
)
class Professional(models.Model):
# add smth here
class Record (models.Model):
professional = models.ForeignKey(Professional, null=True),
availability = models.CharField(
_('available'), max_length=10,
choices=DAY_CHOICES,
blank=True, null=True,
)
class Timetable (models.Model):
record = models.ForeignKey(Record, null=True),
So you will be able to filter either professionals or days or both
๐คsr3z
Source:stackexchange.com