Ignore:
Timestamp:
Aug 8, 2011, 3:06:46 AM (15 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage, test-hooks
Children:
7f16c8e
Parents:
0abb44b
git-author:
Alex Dehnert <adehnert@…> (08/08/11 03:06:46)
git-committer:
Alex Dehnert <adehnert@…> (08/08/11 03:06:46)
Message:

Add class/status/funding

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/models.py

    r2dd6045 rb713ac7  
    1010    description = models.TextField()
    1111    activity_category = models.ForeignKey('ActivityCategory', null=True, blank=True, )
     12    group_class = models.ForeignKey('GroupClass')
     13    group_status = models.ForeignKey('GroupStatus')
     14    group_funding = models.ForeignKey('GroupFunding', null=True, blank=True, )
    1215    website_url = models.URLField()
    1316    constitution_url = models.CharField(max_length=200, blank=True)
     
    153156
    154157
     158class GroupClass(models.Model):
     159    name = models.CharField(max_length=50)
     160    slug = models.SlugField(unique=True, )
     161    description = models.TextField()
     162    gets_publicity = models.BooleanField(help_text="Gets publicity resources such as FYSM or Activities Midway")
     163
     164    def __str__(self, ):
     165        publicity = "no publicity"
     166        if self.gets_publicity:
     167            publicity = "gets publicity"
     168        return "%s (%s)" % (self.name, publicity, )
     169
     170    class Meta:
     171        verbose_name_plural = "group classes"
     172
     173
     174class GroupStatus(models.Model):
     175    name = models.CharField(max_length=50)
     176    slug = models.SlugField(unique=True, )
     177    description = models.TextField()
     178    is_active = models.BooleanField(default=True, help_text="This status represents an active group")
     179
     180    def __str__(self, ):
     181        active = ""
     182        if not self.is_active:
     183            active = " (inactive)"
     184        return "%s%s" % (self.name, active, )
     185
     186    class Meta:
     187        verbose_name_plural= "group statuses"
     188
     189
     190class GroupFunding(models.Model):
     191    name = models.CharField(max_length=50)
     192    slug = models.SlugField(unique=True, )
     193    contact_email = models.EmailField()
     194    funding_list = models.CharField(max_length=32, blank=True, help_text="List that groups receiving funding emails should be on. The database will attempt to make sure that ONLY those groups are on it.")
     195
     196    def __str__(self, ):
     197        return "%s (%s)" % (self.name, self.contact_email, )
     198
     199
    155200class AthenaMoiraAccount_ActiveManager(models.Manager):
    156201    def get_query_set(self, ):
Note: See TracChangeset for help on using the changeset viewer.