1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

boulder-oracle-sprint: Fixed #4440.

git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@5394 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Boulder Sprinters 2007-05-31 18:55:16 +00:00
parent a62ee775ef
commit bc8d41974d

View File

@ -461,7 +461,7 @@ def get_query_set_class(DefaultQuerySet):
def resolve_columns(self, row, fields=()): def resolve_columns(self, row, fields=()):
from django.db.models.fields import DateField, DateTimeField, \ from django.db.models.fields import DateField, DateTimeField, \
TimeField, BooleanField, NullBooleanField, DecimalField TimeField, BooleanField, NullBooleanField, DecimalField, Field
values = [] values = []
for value, field in map(None, row, fields): for value, field in map(None, row, fields):
if isinstance(value, Database.LOB): if isinstance(value, Database.LOB):
@ -470,7 +470,7 @@ def get_query_set_class(DefaultQuerySet):
# order to adhere to the Django convention of using the empty # order to adhere to the Django convention of using the empty
# string instead of null, but only if the field accepts the # string instead of null, but only if the field accepts the
# empty string. # empty string.
if value is None and field.empty_strings_allowed: if value is None and isinstance(field, Field) and field.empty_strings_allowed:
value = '' value = ''
# Convert 1 or 0 to True or False # Convert 1 or 0 to True or False
elif value in (1, 0) and isinstance(field, (BooleanField, NullBooleanField)): elif value in (1, 0) and isinstance(field, (BooleanField, NullBooleanField)):