Ticket #3575: django_db.diff
File django_db.diff, 1.5 KB (added by , 18 years ago) |
---|
-
django/db/models/query.py
636 636 if table_prefix.endswith('.'): 637 637 table_prefix = backend.quote_name(table_prefix[:-1])+'.' 638 638 field_name = backend.quote_name(field_name) 639 # Grab mapping for table and column name to do formatting 640 column_map = '%s%s' % (table_prefix, field_name) 641 if hasattr(backend, 'COLUMN_MAPPING') and backend.COLUMN_MAPPING.has_key(lookup_type): 642 column_map = backend.COLUMN_MAPPING[lookup_type] % column_map 639 643 try: 640 return '%s %s %s' % (table_prefix, field_name, (backend.OPERATOR_MAPPING[lookup_type] % '%s'))644 return '%s %s' % (column_map, (backend.OPERATOR_MAPPING[lookup_type] % '%s')) 641 645 except KeyError: 642 646 pass 643 647 if lookup_type == 'in': -
django/db/backends/postgresql_psycopg2/base.py
120 120 def get_pk_default_value(): 121 121 return "DEFAULT" 122 122 123 # Create a map for to do column functions 124 COLUMN_MAPPING = { 125 'iexact': 'LOWER(%s)', 126 } 127 123 128 OPERATOR_MAPPING = { 124 129 'exact': '= %s', 125 'iexact': ' ILIKE %s',130 'iexact': '= LOWER(%s)', 126 131 'contains': 'LIKE %s', 127 132 'icontains': 'ILIKE %s', 128 133 'gt': '> %s',