Ticket #593: matchoperator.diff
File matchoperator.diff, 3.6 KB (added by , 19 years ago) |
---|
-
core/db/__init__.py
37 37 get_table_list = dbmod.get_table_list 38 38 get_table_description = dbmod.get_table_description 39 39 get_relations = dbmod.get_relations 40 get_fulltext_op_sql = dbmod.get_fulltext_op_sql 40 41 OPERATOR_MAPPING = dbmod.OPERATOR_MAPPING 41 42 DATA_TYPES = dbmod.DATA_TYPES 42 43 DATA_TYPES_REVERSE = dbmod.DATA_TYPES_REVERSE -
core/db/backends/ado_mssql.py
118 118 def get_relations(cursor, table_name): 119 119 raise NotImplementedError 120 120 121 def get_fulltext_op_sql(): 122 raise NotImplementedError 123 121 124 OPERATOR_MAPPING = { 122 125 'exact': '= %s', 123 126 'iexact': 'LIKE %s', -
core/db/backends/mysql.py
132 132 def get_relations(cursor, table_name): 133 133 raise NotImplementedError 134 134 135 def get_fulltext_op_sql(**kwargs): 136 return "match (%s%s) against ('%s' in boolean mode)" 137 135 138 OPERATOR_MAPPING = { 136 139 'exact': '= %s', 137 140 'iexact': 'LIKE %s', -
core/db/backends/postgresql.py
126 126 continue 127 127 return relations 128 128 129 def get_fulltext_op_sql(): 130 raise NotImplementedError 131 129 132 # Register these custom typecasts, because Django expects dates/times to be 130 133 # in Python's native (standard-library) datetime/time format, whereas psycopg 131 134 # use mx.DateTime by default. -
core/db/backends/sqlite3.py
134 134 def get_relations(cursor, table_name): 135 135 raise NotImplementedError 136 136 137 def get_fulltext_op_sql(): 138 raise NotImplementedError 139 137 140 # Operators and fields ######################################################## 138 141 139 142 # SQLite requires LIKE statements to include an ESCAPE clause if the value -
core/meta/__init__.py
1349 1349 return "%s = %%s" % db.get_date_extract_sql(lookup_type, table_prefix + field_name) 1350 1350 elif lookup_type == 'isnull': 1351 1351 return "%s%s IS %sNULL" % (table_prefix, field_name, (not value and 'NOT ' or '')) 1352 elif lookup_type == 'match': 1353 return db.get_fulltext_op_sql() % (table_prefix, field_name, value) 1352 1354 raise TypeError, "Got invalid lookup_type: %s" % repr(lookup_type) 1353 1355 1354 1356 def function_get_object(opts, klass, does_not_exist_exception, **kwargs): -
core/meta/fields.py
189 189 return ["%s%%" % prep_for_like_query(value)] 190 190 elif lookup_type in ('endswith', 'iendswith'): 191 191 return ["%%%s" % prep_for_like_query(value)] 192 elif lookup_type == 'isnull':192 elif lookup_type in ('isnull', 'match'): 193 193 return [] 194 194 raise TypeError, "Field has invalid lookup: %s" % lookup_type 195 195