diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2007-08-20 02:20:33 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2007-08-20 02:20:33 +0000 |
| commit | 1a8f9b2b97d2549fe28c2d9090fece3f29f029fa (patch) | |
| tree | 15e79fab23561c33d7c4a2647c77e8a39b5f367b /django/db/backends/postgresql_psycopg2 | |
| parent | 4f8225051246fb4c1560bbba77a4ead18bc22828 (diff) | |
Implemented BaseDatabaseFeatures and changed all code to access it -- connection.features.foo instead of backend.foo
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5974 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/postgresql_psycopg2')
| -rw-r--r-- | django/db/backends/postgresql_psycopg2/base.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/django/db/backends/postgresql_psycopg2/base.py b/django/db/backends/postgresql_psycopg2/base.py index 87b41877a6..0bcfd46ac4 100644 --- a/django/db/backends/postgresql_psycopg2/base.py +++ b/django/db/backends/postgresql_psycopg2/base.py @@ -4,7 +4,7 @@ PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ -from django.db.backends import BaseDatabaseWrapper +from django.db.backends import BaseDatabaseWrapper, BaseDatabaseFeatures from django.db.backends.postgresql.operations import DatabaseOperations try: import psycopg2 as Database @@ -18,7 +18,11 @@ IntegrityError = Database.IntegrityError psycopg2.extensions.register_type(psycopg2.extensions.UNICODE) +class DatabaseFeatures(BaseDatabaseFeatures): + needs_datetime_string_cast = False + class DatabaseWrapper(BaseDatabaseWrapper): + features = DatabaseFeatures() ops = DatabaseOperations() def _cursor(self, settings): @@ -49,15 +53,6 @@ class DatabaseWrapper(BaseDatabaseWrapper): self.ops.postgres_version = [int(val) for val in cursor.fetchone()[0].split()[1].split('.')] return cursor -allows_group_by_ordinal = True -allows_unique_and_pk = True -autoindexes_primary_keys = True -needs_datetime_string_cast = False -needs_upper_for_iops = False -supports_constraints = True -supports_tablespaces = False -uses_case_insensitive_names = False - OPERATOR_MAPPING = { 'exact': '= %s', 'iexact': 'ILIKE %s', |
