#14569: Raw query for date field returns unicode instead of datetime object in
sqlite
----------------------------------------------+-----------------------------
Reporter: robin | Owner: nobody
Status: new | Milestone:
Component: Database layer (models, ORM) | Version: 1.2
Keywords: raw query date sqlite postgresql | Stage: Unreviewed
Has_patch: 0 |
----------------------------------------------+-----------------------------
Using sqlite
{{{
>>> m = MyModel.objects.raw('select id,max(date_added) as d from
app_modelname group by id')
>>> m[0].d
u'2010-10-26 04:11:33.123513'
}}}
Whereas with postgresql
{{{
>>> m[0].d
datetime.datetime(2010, 10, 26, 4, 11, 33)
}}}
I believe the result returning a datetime object by postgresql is correct,
whereas sqlite is not.
--
Ticket URL: <http://code.djangoproject.com/ticket/14569>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en.