class Committee(BasePage): """ Committees Plugin. Similar to Pages with extra fields. """ slug = SlugField(_('URL Path'), unique=True) mission = tinymce_models.HTMLField(null=True, blank=True) notes = tinymce_models.HTMLField(null=True, blank=True) sponsors = tinymce_models.HTMLField(blank=True, default='') contact_name = models.CharField(max_length=200, null=True, blank=True) contact_email = models.CharField(max_length=200, null=True, blank=True) join_link = models.CharField(max_length=200, null=True, blank=True) group = models.ForeignKey(Group, on_delete=models.CASCADE) perms = GenericRelation(ObjectPermission, object_id_field="object_id", content_type_field="content_type") objects = CommitteeManager() def __str__(self): return str(self.title) class Meta: # permissions = (("view_committee", "Can view committee"),) app_label = 'committees' def get_absolute_url(self): return reverse('committees.detail', args=[self.slug]) def get_meta(self, name): """ This method is standard across all models that are related to the Meta model. Used to generate dynamic meta information niche to this model. """ return CommitteeMeta().get_meta(self, name) def officers(self): return Officer.objects.filter(committee=self).order_by('pk')
class Committee(BasePage): """ Committees Plugin. Similar to Pages with extra fields. """ mission = tinymce_models.HTMLField(null=True, blank=True) notes = tinymce_models.HTMLField(null=True, blank=True) contact_name = models.CharField(max_length=200, null=True, blank=True) contact_email = models.CharField(max_length=200, null=True, blank=True) join_link = models.CharField(max_length=200, null=True, blank=True) group = models.ForeignKey(Group) perms = GenericRelation(ObjectPermission, object_id_field="object_id", content_type_field="content_type") objects = CommitteeManager() def __unicode__(self): return unicode(self.title) class Meta: permissions = (("view_committee", "Can view committee"), ) app_label = 'committees' @models.permalink def get_absolute_url(self): return ("committees.detail", [self.slug]) def get_meta(self, name): """ This method is standard across all models that are related to the Meta model. Used to generate dynamic meta information niche to this model. """ return CommitteeMeta().get_meta(self, name) def officers(self): return Officer.objects.filter(committee=self).order_by('pk')