diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-08-20 03:26:55 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-08-20 03:26:55 +0000 |
| commit | 14db37319bd2a73b796d4b1a078fa7f162fc25e8 (patch) | |
| tree | f3ca7f4b56187afb5a61cdb0d4b1540e0b394a01 /django/db/backends/postgresql/base.py | |
| parent | b3912d360991f0e34beb9f584a21c0c532f822ac (diff) | |
Refactored OPERATOR_MAPPING so that it exists as django.db.connection.operators instead of django.db.backend.OPERATOR_MAPPING. Refs #5106
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5982 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/postgresql/base.py')
| -rw-r--r-- | django/db/backends/postgresql/base.py | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py index 755a34231c..2b260aac36 100644 --- a/django/db/backends/postgresql/base.py +++ b/django/db/backends/postgresql/base.py @@ -62,6 +62,22 @@ class DatabaseFeatures(BaseDatabaseFeatures): class DatabaseWrapper(BaseDatabaseWrapper): features = DatabaseFeatures() ops = DatabaseOperations() + operators = { + 'exact': '= %s', + 'iexact': 'ILIKE %s', + 'contains': 'LIKE %s', + 'icontains': 'ILIKE %s', + 'regex': '~ %s', + 'iregex': '~* %s', + 'gt': '> %s', + 'gte': '>= %s', + 'lt': '< %s', + 'lte': '<= %s', + 'startswith': 'LIKE %s', + 'endswith': 'LIKE %s', + 'istartswith': 'ILIKE %s', + 'iendswith': 'ILIKE %s', + } def _cursor(self, settings): set_tz = False @@ -111,20 +127,3 @@ Database.register_type(Database.new_type((1114,1184), "TIMESTAMP", util.typecast Database.register_type(Database.new_type((16,), "BOOLEAN", util.typecast_boolean)) Database.register_type(Database.new_type((1700,), "NUMERIC", util.typecast_decimal)) Database.register_type(Database.new_type(Database.types[1043].values, 'STRING', typecast_string)) - -OPERATOR_MAPPING = { - 'exact': '= %s', - 'iexact': 'ILIKE %s', - 'contains': 'LIKE %s', - 'icontains': 'ILIKE %s', - 'regex': '~ %s', - 'iregex': '~* %s', - 'gt': '> %s', - 'gte': '>= %s', - 'lt': '< %s', - 'lte': '<= %s', - 'startswith': 'LIKE %s', - 'endswith': 'LIKE %s', - 'istartswith': 'ILIKE %s', - 'iendswith': 'ILIKE %s', -} |
