Hi, encountered a problem recently with SelectDateWidget. I'm not very
sure what I did wrong.

from django.newforms.extras.widgets import SelectDateWidget
#other imports

class JustAForm(forms.Form):
    date_of_birth = forms.DateField(label = 'date of birth',widget =
SelectDateWidget(years = range(1950, 1990)))
    #other fields
    def save(self):
        #create UserProfile
        #setting several fields to the model
        new_user_profile.date_of_birth =
self.cleaned_data['date_of_birth']
        new_user_profile.save() #save!

Apparently, all my fields are doing okay except when it comes to
saving the date_of_birth which is using SelectDateWidget (the widget
display correctly on the browser). I had no problems earlier when
using a text input for date_of_birth.

Thanks for any help that could get me saving date_of_birth it without
error.

The error message:

Exception Type:         IntegrityError
Exception Value:        myapp_userprofile.date_of_birth may not be NULL
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to