Ticket #18969: 18969.patch

File 18969.patch, 1.5 KB (added by Türker Sezer, 12 years ago)
  • django/db/backends/__init__.py

    diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
    index 4edde04..84a128d 100644
    a b class BaseDatabaseOperations(object):  
    863863
    864864        `value` is an int, containing the looked-up year.
    865865        """
     866        value = str(value).zfill(4)
    866867        first = '%s-01-01 00:00:00'
    867868        second = '%s-12-31 23:59:59.999999'
    868869        return [first % value, second % value]
  • django/db/backends/mysql/base.py

    diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py
    index 4043014..8fb560a 100644
    a b class DatabaseOperations(BaseDatabaseOperations):  
    316316
    317317    def year_lookup_bounds(self, value):
    318318        # Again, no microseconds
     319        value = str(value).zfill(4)
    319320        first = '%s-01-01 00:00:00'
    320321        second = '%s-12-31 23:59:59.99'
    321322        return [first % value, second % value]
  • django/db/backends/sqlite3/base.py

    diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py
    index 0f0b6b7..4f28898 100644
    a b class DatabaseOperations(BaseDatabaseOperations):  
    198198        return six.text_type(value)
    199199
    200200    def year_lookup_bounds(self, value):
     201        value = str(value).zfill(4)
    201202        first = '%s-01-01'
    202203        second = '%s-12-31 23:59:59.999999'
    203204        return [first % value, second % value]
Back to Top