mirror of
https://github.com/django/django.git
synced 2024-12-24 18:16:19 +00:00
Fixed #13171 -- Corrected the field_subclassing unit test. Thanks to Gabriel Hurley for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12838 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
d18501b0ed
commit
985e4c8dfe
@ -41,14 +41,14 @@ class SmallField(models.Field):
|
||||
def get_db_prep_save(self, value):
|
||||
return unicode(value)
|
||||
|
||||
def get_db_prep_lookup(self, lookup_type, value):
|
||||
def get_prep_lookup(self, lookup_type, value):
|
||||
if lookup_type == 'exact':
|
||||
return force_unicode(value)
|
||||
if lookup_type == 'in':
|
||||
return [force_unicode(v) for v in value]
|
||||
if lookup_type == 'isnull':
|
||||
return []
|
||||
raise FieldError('Invalid lookup type: %r' % lookup_type)
|
||||
raise TypeError('Invalid lookup type: %r' % lookup_type)
|
||||
|
||||
|
||||
class JSONField(models.TextField):
|
||||
|
@ -51,7 +51,7 @@ True
|
||||
>>> MyModel.objects.filter(data__lt=s)
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
FieldError: Invalid lookup type: 'lt'
|
||||
TypeError: Invalid lookup type: 'lt'
|
||||
|
||||
# Serialization works, too.
|
||||
>>> stream = serializers.serialize("json", MyModel.objects.all())
|
||||
|
Loading…
Reference in New Issue
Block a user