class ProfileForm(ModelForm):
birth_date= forms.DateField(widget=forms.SelectDateWidget)
class Meta:
model = Member
exclude = ()
then i expect a dropdownlist for birth_date in template but it is only a regular input
i always work with function base view but now I am working with class base view for first time.
then i have to say i think this is the problem . i mean i can see result of SelectDateWidget in function base view but in class base view NO.
I want to create inline formset according to this tutorial:
https://medium.com/@adandan01/django-inline-formsets-example-mybook-420cc4b6225d
I only add one filed to parent field because i want to save birth_date of user. then i user SelectDateWidget in
forms.py but it dosent work anymore .
It seems nobody had this problem before because i couldn't find my answer from the internet ond Stack Overflow.
can you help me please?
On Monday 24 April 2017 17:26:20 shahab emami wrote:
> class ProfileForm(ModelForm):
> birth_date= forms.DateField(widget=forms.SelectDateWidget)
> class Meta:
> model = Member
> exclude = ()
>
>
> then i expect a dropdownlist for birth_date in template but it is only
> a regular input
class Meta:
widget ={' birth_date': SelectDateWidget() }
model = Member
fields = '__all__'
exclude = ()
Widget should be plural:
widgets ={' birth_date': SelectDateWidget() }
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
django-users...@googlegroups.com.
To post to this group, send email to
django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/48d44fc3-7dff-4d9a-bba9-849106a4f978%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.