#9459 forms.DateTimeField() looses microseconds

69 views
Skip to first unread message

Thomas Guettler

unread,
Sep 9, 2010, 8:43:55 AM9/9/10
to django-d...@googlegroups.com
Hi,

some days ago I uploaded a new patch for this ticket:

http://code.djangoproject.com/ticket/9459

Here is the patch:
http://code.djangoproject.com/attachment/ticket/9459/datetime-microseconds-py25.patch

If the python version is greater-equal than 2.6, it uses %f to parse the microseconds,
for older versions it parses the last integer itself.

Please review it.

Thomas Güttler

--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de

Tobias McNulty

unread,
Sep 9, 2010, 7:38:22 PM9/9/10
to django-d...@googlegroups.com
On Thu, Sep 9, 2010 at 5:43 AM, Thomas Guettler <h...@tbz-pariv.de> wrote:
Here is the patch:
http://code.djangoproject.com/attachment/ticket/9459/datetime-microseconds-py25.patch

If the python version is greater-equal than 2.6, it uses %f to parse the microseconds,
for older versions it parses the last integer itself.

The patch looks reasonable enough to me and I'm excited about getting it in.  Have you tested it on Python 2.4, 2.5, and 2.6?

Cheers,
Tobias
--
Tobias McNulty, Managing Partner
Caktus Consulting Group, LLC
http://www.caktusgroup.com

Thomas Guettler

unread,
Sep 10, 2010, 4:14:12 AM9/10/10
to django-d...@googlegroups.com
Tobias McNulty wrote:
> On Thu, Sep 9, 2010 at 5:43 AM, Thomas Guettler <h...@tbz-pariv.de
> <mailto:h...@tbz-pariv.de>> wrote:
>
> Here is the patch:
> http://code.djangoproject.com/attachment/ticket/9459/datetime-microseconds-py25.patch
>
> If the python version is greater-equal than 2.6, it uses %f to parse
> the microseconds,
> for older versions it parses the last integer itself.
>
>
> The patch looks reasonable enough to me and I'm excited about getting it
> in. Have you tested it on Python 2.4, 2.5, and 2.6?

Sorry, I don't have a Python 2.4 around. Can anyone help?

Thomas

Thomas Guettler

unread,
Sep 20, 2010, 4:35:21 AM9/20/10
to django-d...@googlegroups.com, tob...@caktusgroup.com

I uploaded a new patch (against trunk) which works on Python 2.4:

http://code.djangoproject.com/attachment/ticket/9459/datetime-microseconds-py24.patch

I think it is ready for commit.

Thomas

Tobias McNulty wrote:
> On Thu, Sep 9, 2010 at 5:43 AM, Thomas Guettler <h...@tbz-pariv.de
> <mailto:h...@tbz-pariv.de>> wrote:
>
> Here is the patch:
> http://code.djangoproject.com/attachment/ticket/9459/datetime-microseconds-py25.patch
>
> If the python version is greater-equal than 2.6, it uses %f to parse
> the microseconds,
> for older versions it parses the last integer itself.
>
>
> The patch looks reasonable enough to me and I'm excited about getting it
> in. Have you tested it on Python 2.4, 2.5, and 2.6?
>
> Cheers,
> Tobias

--

Reply all
Reply to author
Forward
0 new messages