Created
November 25, 2020 22:06
-
-
Save pedrohsbarbosa99/825a45aab8be7e825b0292f7c5619231 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Day(models.Model): | |
DAY_CHOICES = ( | |
('SEG', 'Segunda'), | |
('TER', 'Terça'), | |
('QUA', 'Quarta'), | |
('QUI', 'Quinta'), | |
('SEX', 'Sexta') | |
) | |
day = models.CharField(max_length=3, choices=DAY_CHOICES, blank=False, | |
null=False, verbose_name="Dia da semana") | |
class Hour(models.Model): | |
HOUR_CHOICES = ( | |
('08:30', '08:30'), | |
('09:30', '09:30'), | |
('10:30', '10:30'), | |
) | |
hour = models.CharField(max_length=5, choices=HOUR_CHOICES, blank=False, | |
null=False, verbose_name="Horário") | |
class Student(models.Model): | |
name = models.CharField(max_length=255, verbose_name='Nome Aluno') | |
day_id = models.ForeignKey(Day, on_delete=models.CASCADE, null=True) | |
hour_id = models.ForeignKey(Hour, on_delete=models.CASCADE, null=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment