Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » DateField and SelectDateWidget - How do you set the range for the widget? [RSS Feed]

#1 Jan. 5, 2011 20:47:58

Mike S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

DateField and SelectDateWidget - How do you set the range for the widget?


Well, 2011 brought a bug I'm not sure what to do with. I have a view
that contains a form that lets a user select a date range.
The field is defined as

start_date =
forms.DateField(initial=date(d.year,d.month,1),widget=SelectDateWidget())

My problem is that as of the 1st of January 2011, the minimum date shown
is 01/01/2011, which means people can't select data from last year. I can't find
anything in the documentation that would let me change the range of dates shown
in
the SelectDateWidget. Any suggestions?


--
Mike Seidle

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Jan. 5, 2011 20:59:08

Shawn M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

DateField and SelectDateWidget - How do you set the range for the widget?


http://docs.djangoproject.com/en/dev/ref/forms/widgets/Search for "year" on this page and it has what you need.

Shawn

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 Jan. 5, 2011 21:06:00

Mike S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

DateField and SelectDateWidget - How do you set the range for the widget?


Thank you. Problem solved.

On Wednesday, January 05, 2011 03:58:59 pm Shawn Milochik wrote:

>http://docs.djangoproject.com/en/dev/ref/forms/widgets/>
> Search for "year" on this page and it has what you need.
>
> Shawn

--
Mike Seidle

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

  • Root
  • » Django
  • » DateField and SelectDateWidget - How do you set the range for the widget? [RSS Feed]

Board footer

Moderator control

Enjoy the 20th of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support