Monday, April 24, 2017

SelectDateWidget dosent work

hello
i have a birth date filed in my  model this:


                                     birth_date   = models.DateField (blank=True,null=True)

my forms.py i have this:


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?







--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@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/1657d161-e076-4984-9fe6-07a2215250ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment