Skip to content

Instantly share code, notes, and snippets.

Last active Mar 22, 2020
What would you like to do?
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"{} report for {self.exclusion.student}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment