mirror of https://github.com/django/django.git
Removed stray references to (now deprecated) !__ne query type.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3254 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
cc26eb49a8
commit
08cac47ba0
|
@ -122,7 +122,6 @@ OPERATOR_MAPPING = {
|
|||
'iexact': 'LIKE %s',
|
||||
'contains': 'LIKE %s',
|
||||
'icontains': 'LIKE %s',
|
||||
'ne': '!= %s',
|
||||
'gt': '> %s',
|
||||
'gte': '>= %s',
|
||||
'lt': '< %s',
|
||||
|
|
|
@ -162,7 +162,7 @@ class Field(object):
|
|||
|
||||
def get_db_prep_lookup(self, lookup_type, value):
|
||||
"Returns field's value prepared for database lookup."
|
||||
if lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte', 'ne', 'year', 'month', 'day', 'search'):
|
||||
if lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte', 'year', 'month', 'day', 'search'):
|
||||
return [value]
|
||||
elif lookup_type in ('range', 'in'):
|
||||
return value
|
||||
|
@ -414,7 +414,7 @@ class DateField(Field):
|
|||
def get_db_prep_lookup(self, lookup_type, value):
|
||||
if lookup_type == 'range':
|
||||
value = [str(v) for v in value]
|
||||
elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte', 'ne') and hasattr(value, 'strftime'):
|
||||
elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte') and hasattr(value, 'strftime'):
|
||||
value = value.strftime('%Y-%m-%d')
|
||||
else:
|
||||
value = str(value)
|
||||
|
|
Loading…
Reference in New Issue