diff -r dbeb834dc792 django/db/backends/sqlite3/base.py
a
|
b
|
|
211 | 211 | except (ValueError, TypeError): |
212 | 212 | return None |
213 | 213 | if lookup_type == 'week_day': |
214 | | return unicode((dt.isoweekday() % 7) + 1) |
| 214 | return (dt.isoweekday() % 7) + 1 |
215 | 215 | else: |
216 | | return unicode(getattr(dt, lookup_type)) |
| 216 | return getattr(dt, lookup_type) |
217 | 217 | |
218 | 218 | def _sqlite_date_trunc(lookup_type, dt): |
219 | 219 | try: |
diff -r dbeb834dc792 django/db/models/fields/__init__.py
a
|
b
|
|
493 | 493 | curry(cls._get_next_or_previous_by_FIELD, field=self, is_next=False)) |
494 | 494 | |
495 | 495 | def get_db_prep_lookup(self, lookup_type, value): |
496 | | # For "__month", "__day", and "__week_day" lookups, convert the value |
497 | | # to a string so the database backend always sees a consistent type. |
| 496 | # For "__month", "__day", and "__week_day" lookups, convert the value |
| 497 | # to an int so the database backend always sees a consistent type. |
498 | 498 | if lookup_type in ('month', 'day', 'week_day'): |
499 | | return [force_unicode(value)] |
| 499 | return [int(value)] |
500 | 500 | return super(DateField, self).get_db_prep_lookup(lookup_type, value) |
501 | 501 | |
502 | 502 | def get_db_prep_value(self, value): |