Re: help with time

2012-03-03 Thread ajohnston
> You'll have to add another loop for the hours if you want more than just > 12:xx. Actually, after I hit send, I was sort of curious about how to handle the hours if you cross over from a.m. to p.m., but you just have add another range to the comprehension, and use 24-hour format in the hour ran

Re: help with time

2012-03-03 Thread ajohnston
On Mar 3, 12:54 am, Scott Macri wrote: > OK, I guess a better question is how do I switch my time outputs using > datetime.time from 24-hour clock to 12-hour clock so I can use am/pm? > I think this will work for what you need: >>> import datetime >>> TIME_CHOICES = [(datetime.time(12, min), dat

Re: help with time

2012-03-02 Thread Scott Macri
OK, I guess a better question is how do I switch my time outputs using datetime.time from 24-hour clock to 12-hour clock so I can use am/pm? On Sat, Mar 3, 2012 at 12:13 AM, 赵帅 wrote: > You can change the contents of TIME_CHOICES,every time before render one > template, since django render one fo

Re: help with time

2012-03-02 Thread 赵帅
You can change the contents of TIME_CHOICES,every time before render one template, since django render one form up to the attribute of the form . 2012/3/3 Scott Macri > OK, I'm experimenting with time. To be specific datetime.time. My > goal is to generate a list of times in a pull down menu s

help with time

2012-03-02 Thread Scott Macri
OK, I'm experimenting with time. To be specific datetime.time. My goal is to generate a list of times in a pull down menu so when the user saves the form it populates the db with the proper type. In order to use a model with choices, which is what I've done, I have to do something like this: TI