mirror of
https://github.com/django/django.git
synced 2025-10-25 06:36:07 +00:00
fixes #989 - new 'no' translations for JavaScript
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1534 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -132,6 +132,12 @@ OPERATOR_MAPPING = {
|
||||
'endswith': 'LIKE %s',
|
||||
'istartswith': 'LIKE %s',
|
||||
'iendswith': 'LIKE %s',
|
||||
'notcontains': 'NOT LIKE %s',
|
||||
'notstartswith': 'NOT LIKE %s',
|
||||
'notendswith': 'NOT LIKE %s',
|
||||
'inotcontains': 'NOT LIKE %s',
|
||||
'inotstartswith': 'NOT LIKE %s',
|
||||
'inotendswith': 'NOT LIKE %s',
|
||||
}
|
||||
|
||||
DATA_TYPES = {
|
||||
|
||||
@@ -146,6 +146,12 @@ OPERATOR_MAPPING = {
|
||||
'endswith': 'LIKE BINARY %s',
|
||||
'istartswith': 'LIKE %s',
|
||||
'iendswith': 'LIKE %s',
|
||||
'notcontains': 'NOT LIKE BINARY %s',
|
||||
'notstartswith': 'NOT LIKE BINARY %s',
|
||||
'notendswith': 'NOT LIKE BINARY %s',
|
||||
'inotcontains': 'NOT LIKE %s',
|
||||
'inotstartswith': 'NOT LIKE %s',
|
||||
'inotendswith': 'NOT LIKE %s',
|
||||
}
|
||||
|
||||
# This dictionary maps Field objects to their associated MySQL column
|
||||
|
||||
@@ -151,6 +151,12 @@ OPERATOR_MAPPING = {
|
||||
'endswith': 'LIKE %s',
|
||||
'istartswith': 'ILIKE %s',
|
||||
'iendswith': 'ILIKE %s',
|
||||
'notcontains': 'NOT LIKE %s',
|
||||
'notstartswith': 'NOT LIKE %s',
|
||||
'notendswith': 'NOT LIKE %s',
|
||||
'inotcontains': 'NOT ILIKE %s',
|
||||
'inotstartswith': 'NOT ILIKE %s',
|
||||
'inotendswith': 'NOT ILIKE %s',
|
||||
}
|
||||
|
||||
# This dictionary maps Field objects to their associated PostgreSQL column
|
||||
|
||||
@@ -153,6 +153,12 @@ OPERATOR_MAPPING = {
|
||||
'endswith': "LIKE %s ESCAPE '\\'",
|
||||
'istartswith': "LIKE %s ESCAPE '\\'",
|
||||
'iendswith': "LIKE %s ESCAPE '\\'",
|
||||
'notcontains': "NOT LIKE %s ESCAPE '\\'",
|
||||
'notstartswith': "NOT LIKE %s ESCAPE '\\'",
|
||||
'notendswith': "NOT LIKE %s ESCAPE '\\'",
|
||||
'inotcontains': "NOT LIKE %s ESCAPE '\\'",
|
||||
'inotstartswith': "NOT LIKE %s ESCAPE '\\'",
|
||||
'inotendswith': "NOT LIKE %s ESCAPE '\\'",
|
||||
}
|
||||
|
||||
# SQLite doesn't actually support most of these types, but it "does the right
|
||||
|
||||
@@ -181,13 +181,13 @@ class Field(object):
|
||||
return value
|
||||
elif lookup_type == 'year':
|
||||
return ['%s-01-01' % value, '%s-12-31' % value]
|
||||
elif lookup_type in ('contains', 'icontains'):
|
||||
elif lookup_type in ('contains', 'icontains', 'notcontains', 'inotcontains'):
|
||||
return ["%%%s%%" % prep_for_like_query(value)]
|
||||
elif lookup_type == 'iexact':
|
||||
return [prep_for_like_query(value)]
|
||||
elif lookup_type in ('startswith', 'istartswith'):
|
||||
elif lookup_type in ('startswith', 'istartswith', 'notstartswith', 'inotstartswith'):
|
||||
return ["%s%%" % prep_for_like_query(value)]
|
||||
elif lookup_type in ('endswith', 'iendswith'):
|
||||
elif lookup_type in ('endswith', 'iendswith', 'notendswith', 'inotendswith'):
|
||||
return ["%%%s" % prep_for_like_query(value)]
|
||||
elif lookup_type == 'isnull':
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user