diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py index 15b0e983ad..8f24332fb3 100644 --- a/django/db/backends/sqlite3/base.py +++ b/django/db/backends/sqlite3/base.py @@ -187,7 +187,7 @@ def _sqlite_extract(lookup_type, dt): dt = util.typecast_timestamp(dt) except (ValueError, TypeError): return None - return unicode(getattr(dt, lookup_type)) + return getattr(dt, lookup_type) def _sqlite_date_trunc(lookup_type, dt): try: diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 7ed497cb09..7f823bb546 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -494,7 +494,7 @@ class DateField(Field): # For "__month" and "__day" lookups, convert the value to a string so # the database backend always sees a consistent type. if lookup_type in ('month', 'day'): - return [force_unicode(value)] + return [int(value)] return super(DateField, self).get_db_prep_lookup(lookup_type, value) def get_db_prep_value(self, value):