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 Exclusion(models.Model): | |
""" | |
Models a period of time we wish to exclude a particular student from being included in some data report. | |
""" | |
student = models.ForeignKey(Student, on_delete=models.CASCADE) | |
start = models.DateField("exclusion_start") | |
end = models.DateField("exclusion_end") | |
active = models.BooleanField(verbose_name="Still send digital communications.", default=True) | |
def __str__(self): | |
return f"Exclusion for {self.student}" | |
class Report(models.Model): | |
exclusion = models.OneToOneField(Exclusion, on_delete=models.CASCADE) | |
name = models.CharField(blank=True, null=True, max_length=100) | |
def __str__(self): | |
return f"{self.name} report for {self.exclusion.student}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment