Re: Help a noob with a stupid question - forms

2009-05-12 Thread Margie
This is a great example for helping people (me) understand how to write their own widgets. I won't even pretend that I fully understand your code, but I'm getting there. Very useful, thanks so much for posting it. Margie On May 12, 8:17 am, George Song wrote: > On 5/12/2009 7:05 AM, zachp wr

Re: Help a noob with a stupid question - forms

2009-05-12 Thread rskm1
On May 12, 6:47 am, zachp wrote: > ... I need the user who does this to be able to select a > month (and possibly a year) for the drawing she wants to run. I need > django to convert those two data points into a datetime object for me, > but it's not readily obvious how to do that. Are you SURE

Re: Help a noob with a stupid question - forms

2009-05-12 Thread George Song
On 5/12/2009 7:05 AM, zachp wrote: > Yes, but the calendar widget isn't what I want. My user only really > needs to pick a month (and maybe a year) but not a day. I could resort > to using that field type, but I wanted to see if I could overcome this > problem since, at least in my opinion, the ca

Re: Help a noob with a stupid question - forms

2009-05-12 Thread Sean Brant
Oh i see. Have a look at this widget from django.forms.extras.widgets import SelectDateWidget date = forms.DateField(widget=SelectDateWidget) This will display Month, Day, and Year as separate selects. I would probably subclass it to drop the Day field. Just automatically have it set in the bac

Re: Help a noob with a stupid question - forms

2009-05-12 Thread zachp
Yes, but the calendar widget isn't what I want. My user only really needs to pick a month (and maybe a year) but not a day. I could resort to using that field type, but I wanted to see if I could overcome this problem since, at least in my opinion, the calendar widget might be a little confusing.

Re: Help a noob with a stupid question - forms

2009-05-12 Thread Sean Brant
Did you try date = models.DateTimeField(). This will show up in the admin tool as a calendar widget that you can use to select the date. Django takes care of converting the dates into Python objects and into whatever format your database needs for storing. You could also just use a DateField if yo

Help a noob with a stupid question - forms

2009-05-12 Thread zachp
Hi, I'm completely new to django, so please bear with me. My first project is a site which handles a monthly prize drawing for my company. People build up points throughout the month by carpooling/ biking to work, etc, and at the end of the month a drawing is done to determine a winner. My questio