summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorIan Kelly <ian.g.kelly@gmail.com>2009-03-13 19:58:56 +0000
committerIan Kelly <ian.g.kelly@gmail.com>2009-03-13 19:58:56 +0000
commit0ced9f68f3d8df6d09f538101c8cf94511a199f0 (patch)
tree0bcae10f90c4daa58a140f037a1b577da558c125 /django
parent6922925abc8b840322509f88f3a1bc2024d1843e (diff)
[1.0.X] Fixed #10238: coerce TextField values to unicode in the oracle backend. Backport of [10049] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10050 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/db/backends/oracle/query.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/db/backends/oracle/query.py b/django/db/backends/oracle/query.py
index de169d6901..1ca32c0c66 100644
--- a/django/db/backends/oracle/query.py
+++ b/django/db/backends/oracle/query.py
@@ -6,6 +6,7 @@ Derives from: django.db.models.sql.query.Query
import datetime
from django.db.backends import util
+from django.utils.encoding import force_unicode
# Cache. Maps default query class to new Oracle query class.
_classes = {}
@@ -57,6 +58,9 @@ def query_class(QueryClass, Database):
TimeField, BooleanField, NullBooleanField, DecimalField, Field
if isinstance(value, Database.LOB):
value = value.read()
+ if field and field.get_internal_type() == 'TextField':
+ value = force_unicode(value)
+
# Oracle stores empty strings as null. We need to undo this in
# order to adhere to the Django convention of using the empty
# string instead of null, but only if the field accepts the