Changeset 2450
- Timestamp:
- 02/28/06 21:17:24 (3 years ago)
- Files:
-
- django/trunk/django/core/db/backends/mysql.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/db/backends/mysql.py
r2348 r2450 107 107 # MySQL doesn't support DATE_TRUNC, so we fake it by subtracting intervals. 108 108 # If you know of a better way to do this, please file a Django ticket. 109 # Note that we can't use DATE_FORMAT directly because that causes the output 110 # to be a string rather than a datetime object, and we need MySQL to return 111 # a date so that it's typecasted properly into a Python datetime object. 109 112 subtractions = ["interval (DATE_FORMAT(%s, '%%%%s')) second - interval (DATE_FORMAT(%s, '%%%%i')) minute - interval (DATE_FORMAT(%s, '%%%%H')) hour" % (field_name, field_name, field_name)] 110 113 if lookup_type in ('year', 'month'):
