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, 赵帅 <rostin...@gmail.com> wrote: > 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 <scottma...@gmail.com> >> >> 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: >> >> TIME_CHOICES = ( >> (datetime.time(12,0), '12:00 PM')), >> (datetime.time(12,15), '12:15 PM')), >> ) >> >> Is there an easier way to do this? Maybe a way to automate it without >> having to create a nested mess? I've tried automating it, but am not >> having much luck. I was hoping for something similar to the >> SelectDateWidget, but it doesn't exist for time only. >> >> Thanks. >> >> -- >> Scott >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To post to this group, send email to django-users@googlegroups.com. >> To unsubscribe from this group, send email to >> django-users+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/django-users?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. -- Scott A. Macri www.ScottMacri.com (571) 234-1581 -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.