Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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...
commit 4915d1d02f410e6c30d05c099fedfb73aaf31ce9 1 parent d78ff63
Malcolm Tredinnick authored April 12, 2009
2  django/db/backends/sqlite3/base.py
@@ -187,7 +187,7 @@ def _sqlite_extract(lookup_type, dt):
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:
2  django/db/models/fields/__init__.py
@@ -494,7 +494,7 @@ def get_db_prep_lookup(self, lookup_type, value):
494 494
         # For "__month" and "__day" lookups, convert the value to a string so
495 495
         # the database backend always sees a consistent type.
496 496
         if lookup_type in ('month', 'day'):
497  
-            return [force_unicode(value)]
  497
+            return [int(value)]
498 498
         return super(DateField, self).get_db_prep_lookup(lookup_type, value)
499 499
 
500 500
     def get_db_prep_value(self, value):

0 notes on commit 4915d1d

Please sign in to comment.
Something went wrong with that request. Please try again.