~ris/loco-team-portal/fix-552762

« back to all changes in this revision

Viewing changes to loco_directory/teams/models.py

  • Committer: Daniel Holbach
  • Date: 2009-12-21 11:03:49 UTC
  • Revision ID: daniel.holbach@canonical.com-20091221110349-bo2zmme5i2e4egif
start at revision 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from django.db import models
 
2
from django.utils.translation import ugettext as _
 
3
 
 
4
class TeamManager(models.Manager):
 
5
    pass
 
6
 
 
7
class TeamAdministrator(models.Model):
 
8
    lpid = models.SlugField(_("Launchpad ID"), max_length=40, null=False, blank=False)
 
9
    def __unicode__(self):
 
10
       return u'%s' % (self.lpid)
 
11
 
 
12
class Team(models.Model):
 
13
    lp_name = models.SlugField(_("Launchpad Team ID"), max_length=40, null=True)
 
14
    name = models.CharField(_("Team Name"), max_length=80, null=True)
 
15
    country = models.CharField(_("Country"), max_length=50, null=True, blank=True)
 
16
    spr = models.CharField(_("State/Province/Region"), max_length=50, null=True, blank=True)
 
17
    city = models.CharField(_("City"), max_length=50, null=True, blank=True)
 
18
    wiki_url = models.URLField(_("Ubuntu Wiki Page"), verify_exists=False, null=True, blank=True)
 
19
    web_url = models.URLField(_("Website"), verify_exists=False, null=True, blank=True)
 
20
    ml_url = models.URLField(_("Mailing List URL"), verify_exists=False, null=True, blank=True)
 
21
    forum_url = models.URLField(_("Forums URL"), verify_exists=False, null=True, blank=True)
 
22
    email = models.EmailField(_("Email Address"), null=True, blank=True)
 
23
    irc_chan = models.CharField(_("IRC Channel"),
 
24
                                max_length=25, null=True, blank=True,
 
25
                                help_text=_("IRC Channel name that is hosted on "
 
26
                                "the freenode IRC network. Ex. #ubuntu-chicago"))
 
27
    provides_support = models.BooleanField(_("Provides local support"),
 
28
                                           default=True)
 
29
    approved = models.BooleanField(_("Approved Team"), default=False)
 
30
    approved_date = models.DateField(_("Date Approved"), null=True, blank=True)
 
31
    expires_date = models.DateField(_("Date Expires"), null=True, blank=True)
 
32
    owner = models.SlugField(_("Launchpad Team Owner"), null=True, blank=False)
 
33
    admins = models.ManyToManyField(TeamAdministrator)
 
34
    
 
35
    objects = TeamManager()
 
36
    
 
37
    class Meta:
 
38
        db_table = 'teams'
 
39
        ordering = ('approved', 'name',)
 
40
        
 
41
    def __unicode__(self):
 
42
        return self.lp_name
 
43