Skip to content

Commit

Permalink
personal: Add status and special_functions to Contact
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed Jan 15, 2025
1 parent fc7c957 commit a59d086
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mpicms/personal/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ class Contact(index.Indexed, ClusterableModel):
priority = models.PositiveSmallIntegerField(
_("priority"), blank=True, default=0, validators=[MaxValueValidator(999)],
help_text=_("Priority from 0-999 to determine the sorting order."))
status = models.ForeignKey(Status, on_delete=models.SET_NULL, blank=True, null=True)
special_functions = models.ManyToManyField(SpecialFunction, blank=True)

objects = ContactManager()

Expand All @@ -138,9 +140,12 @@ class Contact(index.Indexed, ClusterableModel):
FieldPanel('last_name'),
FieldPanel('academic_suffix'),
], heading='Name'),
FieldPanel('status'),
InlinePanel(
'positions', label="Positions",
panels=None),
panels=None
),
FieldPanel('special_functions'),
FieldPanel('email'),
FieldPanel('phone'),
FieldPanel('room'),
Expand Down Expand Up @@ -213,7 +218,7 @@ class WrittenConsent(models.Model):
ref = models.CharField("ID", max_length=10, unique=True)
comment = models.TextField("comment", blank=True)
valid = models.BooleanField(_("valid"), default=True)
contacts = models.ManyToManyField(Contact, blank = True)
contacts = models.ManyToManyField(Contact, blank=True)

def __str__(self):
return "Written Consent #" + self.ref + " (" + ", ".join(str(c) for c in self.contacts.all()) + ")"
Expand Down

0 comments on commit a59d086

Please sign in to comment.