On Jan 8, 2008 6:33 PM, Lucas Di Pentima <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I'm a Django newbie trying to learn this wonderful framework, so if
> my question is too obvious, please bear with me :-)
>
> I'm learning how to use the newforms from Django 0.96, as it comes
> installed on a Debian GNU/Linux Lenny (testing), I'm playing around
> with the SpliDateTimeField:
>
>
> -------------------------------------------------------------------------------------------------
> class GraphForm(forms.Form):
> from_date = forms.SplitDateTimeField(widget=forms.SplitDateTimeWidget)
> to_date = forms.SplitDateTimeField(widget=forms.SplitDateTimeWidget)
>
> def graph(request):
> if request.method == 'POST':
> f = GraphForm(request.POST)
> else:
> now = datetime.now()
> f = GraphForm(initial={'from_date': now - timedelta(0, 8*3600),
> 'to_date': now})
> return render_to_response('app.html', {'form': f})
>
> -------------------------------------------------------------------------------------------------
>
> When I load the webpage, I get the two SplitDateTimeField fields
> correctly, with the initial values on them correctly...the only
> curious detail is that the time field is something like
> "12:53:58.988741", so when I click on the submit button (which reloads
> the same webpage with POST method), I gey a time validation error.
> If I edit the time field and remove the millionths of a second, like:
> "12:53:58"...the form correctly validate the time.
>
> So my question is: Is this a bug? Or I shall customize the time output
> format in some way?
>
Looks like it was a bug, fixed in October:
http://code.djangoproject.com/changeset/6578
So, you shouldn't see the problem if you switch to using an SVN checkout
instead of 0.96.
Karen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---