Browse files

[1.0.X] Fixed #10071 -- Changed some internal database data represent…

…ations.

We now pass numbers used in data queries as actualy numbers (integers) to the
database backends, rather than string forms. This is easier for some of the
less flexible backeds.

Patch from Leo Soto.

Backport of r10530 from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10531 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent d78ff63 commit 4915d1d02f410e6c30d05c099fedfb73aaf31ce9 @malcolmt malcolmt committed Apr 12, 2009
Showing with 2 additions and 2 deletions.
  1. +1 −1 django/db/backends/sqlite3/base.py
  2. +1 −1 django/db/models/fields/__init__.py
View
2 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:
View
2 django/db/models/fields/__init__.py
@@ -494,7 +494,7 @@ def get_db_prep_lookup(self, lookup_type, value):
# 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):

0 comments on commit 4915d1d

Please sign in to comment.