class AccountUserInfo(models.Model):
MAN = 'man'
WOMAN = 'woman'
VAGUE = 'vague'
GENDER_CHOICES = [
(VAGUE, 'Vague'),
(MAN, 'Male'),
(WOMAN, 'Female'),
]
def dispatch_account_media_files(instance, filename):
return '{0}/app_accounts/{1}'.format(instance.account.__str__(), filename)
account = models.OneToOneField(AccountUser, on_delete=models.CASCADE)
first_name = models.CharField('First name', max_length=50, blank=True, null=True)
last_name = models.CharField('Last name', max_length=50, blank=True, null=True)
picture = models.ImageField('Picture', upload_to=dispatch_account_media_files, blank=True, null=True)
gender = models.CharField('Gender', max_length=10, choices=GENDER_CHOICES, default=GENDER_CHOICES[0][0])
country = CountryField('Country', blank_label='(select country)', blank=True, null=True)
birthday = models.DateField('Birthday', blank=True, null=True)