Hey Wesley, what sort of widget is it using for the date_of_birth? My guess is that's it's not in a proper date/time format so it ends up null.
I would also recommend changing it to just a DateField since I don't think the time is relevant to a birthday. Good luck! Josh On Tue, Nov 4, 2014 at 2:15 AM, Wesley <[email protected]> wrote: > Hi all, > I hit a problem when custom account profile. > So, actually, I just wanna add birthday and gender(both required) to user > profile, showing the two guys in signup and change form. > > Look at the mezzanine doc center, I find AUTH_PROFILE_MODULE. > > Here is my profile model: > GENDER_CHOICES = ( > ('M', 'Man'), > ('F', 'Woman'), > ) > > class UserProfile(models.Model): > # This field is required. > user = models.OneToOneField(User) > > # Other fields here > date_of_birth = models.DateTimeField() > gender = models.CharField(max_length=1, choices=GENDER_CHOICES) > > and, set AUTH_PROFILE_MODULE = "mytheme.UserProfile" > > So,here is problems: > 1. when adding user from admin site, it says user is successfully added, > but actually it's not. > 2. signup page, alway say that column date_of_birth cannot be null, but > acctually it's has value seen from debug tool. > What's more, althouth it raises error here, but the user is added in > the backend database. > > So, seems signup form doesn't check new added date_of_birth and gender > when doing user.save()? > > Any easy way to do what I want? > > Thanks. > Wesley > > -- > You received this message because you are subscribed to the Google Groups > "Mezzanine Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Mezzanine Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
