aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--account/models.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/account/models.py b/account/models.py
index 04f255c..22b11af 100644
--- a/account/models.py
+++ b/account/models.py
@@ -24,13 +24,28 @@ class UserProfile(models.Model):
('F', _("Female")),
('X', _("Secret")),
)
+ # status choices of is_approved
+ APPROVED_STATUS = (
+ ('Y', _("Yes")),
+ ('N', _("No")),
+ ('C', _("Checking")),
+ )
+ # status choices of is_sponsored
+ SPONSORED_STATUS = (
+ ('Y', _("Yes")),
+ ('N', _("No")),
+ ('C', _("Checking")),
+ )
+ # model fields
user = models.ForeignKey(User, unique=True, verbose_name=_("Username"))
realname = models.CharField(_("Name"), max_length=30)
gender = models.CharField(_("Gender"), max_length=1, choices=GENDERS)
institute = models.CharField(_("Institute"), max_length=100)
# store the infomation about approval and sponsorship
- is_approved = models.BooleanField(_("Is approved"), default=False)
- is_sponsored = models.BooleanField(_("Is sponsored"), default=False)
+ is_approved = models.CharField(_("Is approved"), max_length=1,
+ choices=APPROVED_STATUS, default='C')
+ is_sponsored = models.CharField(_("Is sponsored"), max_length=1,
+ choices=SPONSORED_STATUS, default='C')
class Meta:
verbose_name = _('user profile')