~ubuntuone-pqm-team/canonical-identity-provider/trunk

« back to all changes in this revision

Viewing changes to identityprovider/models/emailaddress.py

  • Committer: Danny Tamez
  • Date: 2010-04-21 15:29:24 UTC
  • Revision ID: danny.tamez@canonical.com-20100421152924-lq1m92tstk2iz75a
Canonical SSO Provider (Open Source) - Initial Commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2010 Canonical Ltd.  This software is licensed under the
 
2
# GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
import datetime
 
5
 
 
6
from django.db import models
 
7
 
 
8
from identityprovider.models import Account, Person
 
9
from identityprovider.models.const import EmailStatus
 
10
 
 
11
__all__ = (
 
12
    'EmailAddress',
 
13
)
 
14
 
 
15
 
 
16
class EmailAddress(models.Model):
 
17
    email = models.TextField()
 
18
    person = models.ForeignKey(Person, db_column='person',
 
19
        blank=True, null=True)
 
20
    status = models.IntegerField(choices=EmailStatus._get_choices())
 
21
    date_created = models.DateTimeField(default=datetime.datetime.utcnow,
 
22
        blank=True, editable=False)
 
23
    account = models.ForeignKey(Account, db_column='account',
 
24
        blank=True, null=True)
 
25
 
 
26
    class Meta:
 
27
        app_label = 'identityprovider'
 
28
        db_table = u'emailaddress'
 
29
 
 
30
    def __unicode__(self):
 
31
        return self.email