On 18 oct. 2011, at 14:48, Daniel Swarbrick wrote:

> On Oct 16, 11:48 am, Aymeric Augustin
> <aymeric.augus...@polytechnique.org> wrote:
>> Hello,
>> 
>> I've implemented the storage and retrieval of aware datetime objects in 
>> SQLite. This involved some refactoring, because SQLite returns datetimes as 
>> strings, and I didn't want to duplicate the parsing code. All database 
>> backends are now covered.
> 
> Is it worth looking at registering a custom converter for SQLite
> (http://docs.python.org/library/sqlite3.html#converting-sqlite-values-
> to-custom-python-types) to handle the date objects?

My sentence wasn't totally accurate: Django's currently using converters for 
datetimes, and I changed them to return aware datetimes.

> Converters can be
> registered per-column - the SELECT query would need to be tweaked to
> hint to the SQLite libs to call the registered converter. I'm not sure
> if that would be too intrusive to the existing Django query builder.

I didn't know that. It could be useful to convert results of aggregation. At 
the moment, I don't know how they are converted to Python types.

Best regards,

-- 
Aymeric Augustin.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to