From aa239e3e5405933af6a29dac3cf587b59a099927 Mon Sep 17 00:00:00 2001 From: Justin Bronn Date: Tue, 5 Aug 2008 17:15:33 +0000 Subject: gis: Merged revisions 7981-8001,8003-8011,8013-8033,8035-8036,8038-8039,8041-8063,8065-8076,8078-8139,8141-8154,8156-8214 via svnmerge from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@8215 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/backends/mysql/base.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'django/db/backends/mysql/base.py') diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index 74138a7b11..3b8d897925 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -63,7 +63,6 @@ class DatabaseFeatures(BaseDatabaseFeatures): inline_fk_references = False empty_fetchmany_value = () update_can_self_select = False - supports_usecs = False class DatabaseOperations(BaseDatabaseOperations): def date_extract_sql(self, lookup_type, field_name): @@ -124,6 +123,24 @@ class DatabaseOperations(BaseDatabaseOperations): else: return [] + def value_to_db_datetime(self, value): + # MySQL doesn't support microseconds + if value is None: + return None + return unicode(value.replace(microsecond=0)) + + def value_to_db_time(self, value): + # MySQL doesn't support microseconds + if value is None: + return None + return unicode(value.replace(microsecond=0)) + + def year_lookup_bounds(self, value): + # Again, no microseconds + first = '%s-01-01 00:00:00' + second = '%s-12-31 23:59:59.99' + return [first % value, second % value] + class DatabaseWrapper(BaseDatabaseWrapper): features = DatabaseFeatures() ops = DatabaseOperations() -- cgit v1.2.1