diff -r fe29498ad607 django/db/backends/sqlite3/base.py
|
a
|
b
|
|
| 187 | 187 | dt = util.typecast_timestamp(dt) |
| 188 | 188 | except (ValueError, TypeError): |
| 189 | 189 | return None |
| 190 | | return unicode(getattr(dt, lookup_type)) |
| | 190 | return getattr(dt, lookup_type) |
| 191 | 191 | |
| 192 | 192 | def _sqlite_date_trunc(lookup_type, dt): |
| 193 | 193 | try: |
diff -r fe29498ad607 django/db/models/fields/__init__.py
|
a
|
b
|
|
| 488 | 488 | # For "__month" and "__day" lookups, convert the value to a string so |
| 489 | 489 | # the database backend always sees a consistent type. |
| 490 | 490 | if lookup_type in ('month', 'day'): |
| 491 | | return [force_unicode(value)] |
| | 491 | return [int(value)] |
| 492 | 492 | return super(DateField, self).get_db_prep_lookup(lookup_type, value) |
| 493 | 493 | |
| 494 | 494 | def get_db_prep_value(self, value): |