comparison bio/models.py @ 609:678a1a2ef55a

For issue 16, add country flag icons to user profiles & forum posts.
author Brian Neal <bgneal@gmail.com>
date Sat, 28 Jul 2012 15:12:09 -0500
parents ee87ea74d46b
children 08d905e38a86
comparison
equal deleted inserted replaced
608:8ddd6490cbc9 609:678a1a2ef55a
10 from django.conf import settings 10 from django.conf import settings
11 from django.core.cache import cache 11 from django.core.cache import cache
12 from django.template.loader import render_to_string 12 from django.template.loader import render_to_string
13 13
14 from core.markup import SiteMarkup 14 from core.markup import SiteMarkup
15 import bio.flags
15 16
16 17
17 # These are the secondary user status enumeration values. 18 # These are the secondary user status enumeration values.
18 (STA_ACTIVE, # User is a full member in good standing. 19 (STA_ACTIVE, # User is a full member in good standing.
19 STA_RESIGNED, # User has voluntarily asked to be removed. 20 STA_RESIGNED, # User has voluntarily asked to be removed.
73 class UserProfile(models.Model): 74 class UserProfile(models.Model):
74 """model to represent additional information about users""" 75 """model to represent additional information about users"""
75 76
76 user = models.ForeignKey(User, unique=True) 77 user = models.ForeignKey(User, unique=True)
77 location = models.CharField(max_length=128, blank=True) 78 location = models.CharField(max_length=128, blank=True)
79 country = models.CharField(max_length=2, blank=True, default='',
80 choices=bio.flags.FLAG_CHOICES,
81 help_text='Optional')
78 birthday = models.DateField(blank=True, null=True, 82 birthday = models.DateField(blank=True, null=True,
79 help_text='Optional; the year is not shown to others') 83 help_text='Optional; the year is not shown to others')
80 occupation = models.CharField(max_length=128, blank=True) 84 occupation = models.CharField(max_length=128, blank=True)
81 interests = models.CharField(max_length=255, blank=True) 85 interests = models.CharField(max_length=255, blank=True)
82 profile_text = models.TextField(blank=True) 86 profile_text = models.TextField(blank=True)