diff --git a/webapp/models.py b/webapp/models.py index c6cea6b..c2bf792 100644 --- a/webapp/models.py +++ b/webapp/models.py @@ -236,6 +236,11 @@ class KaehmyForm(MessageParent): return self.preset_roles.filter(is_board=True).exists() or self.custom_roles.filter(is_board=True) +class Committee(models.Model): + """ Committee model, has many Roles found under variable roles """ + name = models.CharField(max_length=255) + + class Role(PresetRole): """ Model for Role. @@ -253,7 +258,7 @@ class Role(PresetRole): start_date = models.DateField(_('Start date')) end_date = models.DateField(_('End date')) official = models.ForeignKey('Official', related_name='roles') - + committee = models.ForeignKey('Committee', related_name='roles', on_delete=models.SET_NULL, blank=True) class Official(User): """Model representing a guild official.""" diff --git a/webapp/templates/contact.html b/webapp/templates/contact.html index a7643c3..320ce45 100644 --- a/webapp/templates/contact.html +++ b/webapp/templates/contact.html @@ -5,10 +5,33 @@
+
+
+ |
+
+ {{rooli}} + {{ rooli.official.first_name }} {{ rooli.official.last_name }} + {{ rooli.official.email }} + {{ rooli.official.phone_number }} + + |
+
Ei rooleja
+ {% endif %} {% if kaikki %}