diff options
author | Russell Keith-Magee <russell@keith-magee.com> | 2008-08-11 12:11:25 +0000 |
---|---|---|
committer | Russell Keith-Magee <russell@keith-magee.com> | 2008-08-11 12:11:25 +0000 |
commit | 9dc4ba875f21d5690f6ad5995123a67a3c44bafe (patch) | |
tree | 621f876758ac16dceee95faf51973d4b05f1c830 /django/db/backends/postgresql/client.py | |
parent | cec69eb70d1e2f84dc5a7fb172da88a79b0f5063 (diff) | |
download | django-9dc4ba875f21d5690f6ad5995123a67a3c44bafe.tar.gz |
Fixed #5461 -- Refactored the database backend code to use classes for the creation and introspection modules. Introduces a new validation module for DB-specific validation. This is a backwards incompatible change; see the wiki for details.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8296 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/postgresql/client.py')
-rw-r--r-- | django/db/backends/postgresql/client.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/django/db/backends/postgresql/client.py b/django/db/backends/postgresql/client.py index 8123ec7848..28daed833a 100644 --- a/django/db/backends/postgresql/client.py +++ b/django/db/backends/postgresql/client.py @@ -1,15 +1,17 @@ +from django.db.backends import BaseDatabaseClient from django.conf import settings import os -def runshell(): - args = ['psql'] - if settings.DATABASE_USER: - args += ["-U", settings.DATABASE_USER] - if settings.DATABASE_PASSWORD: - args += ["-W"] - if settings.DATABASE_HOST: - args.extend(["-h", settings.DATABASE_HOST]) - if settings.DATABASE_PORT: - args.extend(["-p", str(settings.DATABASE_PORT)]) - args += [settings.DATABASE_NAME] - os.execvp('psql', args) +class DatabaseClient(BaseDatabaseClient): + def runshell(self): + args = ['psql'] + if settings.DATABASE_USER: + args += ["-U", settings.DATABASE_USER] + if settings.DATABASE_PASSWORD: + args += ["-W"] + if settings.DATABASE_HOST: + args.extend(["-h", settings.DATABASE_HOST]) + if settings.DATABASE_PORT: + args.extend(["-p", str(settings.DATABASE_PORT)]) + args += [settings.DATABASE_NAME] + os.execvp('psql', args) |