Changeset 1326
- Timestamp:
- 11/20/05 20:46:15 (2 years ago)
- Files:
-
- django/trunk/django/core/db/backends/ado_mssql.py (modified) (1 diff)
- django/trunk/django/core/db/backends/mysql.py (modified) (1 diff)
- django/trunk/django/core/db/backends/postgresql.py (modified) (1 diff)
- django/trunk/django/core/db/backends/sqlite3.py (modified) (1 diff)
- django/trunk/django/core/meta/__init__.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/db/backends/ado_mssql.py
r1316 r1326 117 117 118 118 OPERATOR_MAPPING = { 119 'exact': '= ',120 'iexact': 'LIKE ',121 'contains': 'LIKE ',122 'icontains': 'LIKE ',123 'ne': '!= ',124 'gt': '> ',125 'gte': '>= ',126 'lt': '< ',127 'lte': '<= ',128 'startswith': 'LIKE ',129 'endswith': 'LIKE ',130 'istartswith': 'LIKE ',131 'iendswith': 'LIKE ',119 'exact': '= %s', 120 'iexact': 'LIKE %s', 121 'contains': 'LIKE %s', 122 'icontains': 'LIKE %s', 123 'ne': '!= %s', 124 'gt': '> %s', 125 'gte': '>= %s', 126 'lt': '< %s', 127 'lte': '<= %s', 128 'startswith': 'LIKE %s', 129 'endswith': 'LIKE %s', 130 'istartswith': 'LIKE %s', 131 'iendswith': 'LIKE %s', 132 132 } 133 133 django/trunk/django/core/db/backends/mysql.py
r1316 r1326 129 129 130 130 OPERATOR_MAPPING = { 131 'exact': '= ',132 'iexact': 'LIKE ',133 'contains': 'LIKE BINARY ',134 'icontains': 'LIKE ',135 'ne': '!= ',136 'gt': '> ',137 'gte': '>= ',138 'lt': '< ',139 'lte': '<= ',140 'startswith': 'LIKE BINARY ',141 'endswith': 'LIKE BINARY ',142 'istartswith': 'LIKE ',143 'iendswith': 'LIKE ',131 'exact': '= %s', 132 'iexact': 'LIKE %s', 133 'contains': 'LIKE BINARY %s', 134 'icontains': 'LIKE %s', 135 'ne': '!= %s', 136 'gt': '> %s', 137 'gte': '>= %s', 138 'lt': '< %s', 139 'lte': '<= %s', 140 'startswith': 'LIKE BINARY %s', 141 'endswith': 'LIKE BINARY %s', 142 'istartswith': 'LIKE %s', 143 'iendswith': 'LIKE %s', 144 144 } 145 145 django/trunk/django/core/db/backends/postgresql.py
r1316 r1326 134 134 135 135 OPERATOR_MAPPING = { 136 'exact': '= ',137 'iexact': 'ILIKE ',138 'contains': 'LIKE ',139 'icontains': 'ILIKE ',140 'ne': '!= ',141 'gt': '> ',142 'gte': '>= ',143 'lt': '< ',144 'lte': '<= ',145 'startswith': 'LIKE ',146 'endswith': 'LIKE ',147 'istartswith': 'ILIKE ',148 'iendswith': 'ILIKE ',136 'exact': '= %s', 137 'iexact': 'ILIKE %s', 138 'contains': 'LIKE %s', 139 'icontains': 'ILIKE %s', 140 'ne': '!= %s', 141 'gt': '> %s', 142 'gte': '>= %s', 143 'lt': '< %s', 144 'lte': '<= %s', 145 'startswith': 'LIKE %s', 146 'endswith': 'LIKE %s', 147 'istartswith': 'ILIKE %s', 148 'iendswith': 'ILIKE %s', 149 149 } 150 150 django/trunk/django/core/db/backends/sqlite3.py
r1316 r1326 132 132 # Operators and fields ######################################################## 133 133 134 # SQLite requires LIKE statements to include an ESCAPE clause if the value 135 # being escaped has a percent or underscore in it. 136 # See http://www.sqlite.org/lang_expr.html for an explanation. 134 137 OPERATOR_MAPPING = { 135 'exact': '=',136 'iexact': 'LIKE',137 'contains': 'LIKE',138 'icontains': 'LIKE',139 'ne': '!=',140 'gt': '>',141 'gte': '>=',142 'lt': '<',143 'lte': '<=',144 'startswith': 'LIKE',145 'endswith': 'LIKE',146 'istartswith': 'LIKE',147 'iendswith': 'LIKE',138 'exact': '= %s', 139 'iexact': "LIKE %s ESCAPE '\\'", 140 'contains': "LIKE %s ESCAPE '\\'", 141 'icontains': "LIKE %s ESCAPE '\\'", 142 'ne': '!= %s', 143 'gt': '> %s', 144 'gte': '>= %s', 145 'lt': '< %s', 146 'lte': '<= %s', 147 'startswith': "LIKE %s ESCAPE '\\'", 148 'endswith': "LIKE %s ESCAPE '\\'", 149 'istartswith': "LIKE %s ESCAPE '\\'", 150 'iendswith': "LIKE %s ESCAPE '\\'", 148 151 } 149 152 django/trunk/django/core/meta/__init__.py
r1319 r1326 1128 1128 field_name = db.db.quote_name(field_name) 1129 1129 try: 1130 return '%s%s %s %%s' % (table_prefix, field_name, db.OPERATOR_MAPPING[lookup_type])1130 return '%s%s %s' % (table_prefix, field_name, (db.OPERATOR_MAPPING[lookup_type] % '%s')) 1131 1131 except KeyError: 1132 1132 pass
