home / django_tickets / tickets

tickets: 8354

This data as json

id created changetime last_pulled_from_trac stage status component type severity version resolution summary description owner reporter keywords easy has_patch needs_better_patch needs_tests needs_docs ui_ux
8354 2008-08-15 21:48:01 2011-09-28 16:12:17 2022-03-06 03:42:01.865581 Accepted closed Database layer (models, ORM)     dev fixed MySQL rejects datetimes with unusual unicode() representations The database adapters assume that {{{unicode(datetime.datetime)}}} will return a string that can be passed to the database. Unfortunately, this assumption is false. Datetime objects with timezones will be formatted as a string that can't be read by MySQL: {{{ >>> test_date datetime.datetime(2008, 8, 15, 21, 31, 8, tzinfo=<UTC>) >>> print unicode(test_date) 2008-08-15 21:31:08+00:00 }}} I've patched the MySQL database adapter to use {{{datetime.strftime()}}} instead of {{{unicode}}} (patch attached). This sort of patch should probably be adapted to other database adapters, so they have more consistent datetime formatting. nobody jmillikin 1.0-blocker 0 1 1 1 0 0
Powered by Datasette · Queries took 1.144ms