from django import forms from django.forms.extras import widgets class FiremanForm(forms.ModelForm): birth_date = forms.DateField(widget=widgets.SelectDateWidget())
On Jan 6, 12:11 am, DragonSlayre <lssay...@gmail.com> wrote: > I've tried using it, but I'm still quite new to django - I put it into > my model file for now, and made my model form looks like this: > > class FiremanForm(ModelForm): > birth_date = models.DateField(widget=SelectDateWidget()) > > But I get an error "got an unexpected keyword argument 'widget' " > From this I gather that I must be writing the wrong thing, but I'm not > sure what I should be writing? > > Thanks a lot > > On Jan 6, 11:29 am, Brot <schla...@gmail.com> wrote: > > > Hello, > > > I have the same issue in my app and there is a widget. You can find it > > here:http://code.djangoproject.com/browser/django/trunk/django/forms/extra... > > > But for me this widget misses a few features and there are open > > tickets with patches, but they are not in trunk yet > > :-(http://code.djangoproject.com/ticket/9124http://code.djangoproject.co... > > > I am working with the latest patch from #6231 and so the widget is now > > useful for me. But I hope that this patch find it's way into django > > trunk! > > > ~Bernd > > > On Jan 5, 11:00 pm, DragonSlayre <lssay...@gmail.com> wrote: > > > > Hi, > > > > I've got a ModelForm, and the model for it contains a birth date field > > > (as a DateField): > > > > class FiremanForm(ModelForm): > > > class Meta: > > > model = Fireman > > > > Currently a single text box is rendered to enter the date, but I'd > > > like to have a drop down list for day, month, year. > > > > I'm guessing that lots of people have come across this, and I was > > > wondering what the best way is to get these drop down lists on the > > > page ? > > > > Are there any widgets that I don't know about that I should be using, > > > or should I be creating my own, or should I be breaking my Fireman's > > > birthdate up into day, month year..... or something else? --~--~---------~--~----~------------~-------~--~----~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---