mirror of
https://github.com/django/django.git
synced 2025-07-05 18:29:11 +00:00
[multi-db] Updated runshell() calls to accept settings.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3412 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e2385e3c53
commit
422aadfe2a
@ -97,7 +97,8 @@ class ConnectionInfo(object):
|
||||
|
||||
def runshell(self):
|
||||
__import__('django.db.backends.%s.client' %
|
||||
self.settings.DATABASE_ENGINE, '', '', ['']).runshell()
|
||||
self.settings.DATABASE_ENGINE, '', '', ['']
|
||||
).runshell(self.settings)
|
||||
|
||||
def reset_queries(self):
|
||||
"""Reset log of queries executed by connection"""
|
||||
|
@ -1,2 +1,2 @@
|
||||
def runshell():
|
||||
def runshell(settings):
|
||||
raise NotImplementedError
|
||||
|
@ -1,7 +1,6 @@
|
||||
from django.conf import settings
|
||||
import os
|
||||
|
||||
def runshell():
|
||||
def runshell(settings):
|
||||
args = ['']
|
||||
args += ["--user=%s" % settings.DATABASE_USER]
|
||||
if settings.DATABASE_PASSWORD:
|
||||
|
@ -1,7 +1,6 @@
|
||||
from django.conf import settings
|
||||
import os
|
||||
|
||||
def runshell():
|
||||
def runshell(settings):
|
||||
args = ''
|
||||
args += settings.DATABASE_USER
|
||||
if settings.DATABASE_PASSWORD:
|
||||
|
@ -1,7 +1,6 @@
|
||||
from django.conf import settings
|
||||
import os
|
||||
|
||||
def runshell():
|
||||
def runshell(settings):
|
||||
args = ['psql']
|
||||
if settings.DATABASE_USER:
|
||||
args += ["-U", settings.DATABASE_USER]
|
||||
|
@ -1,6 +1,5 @@
|
||||
from django.conf import settings
|
||||
import os
|
||||
|
||||
def runshell():
|
||||
def runshell(settings):
|
||||
args = ['', settings.DATABASE_NAME]
|
||||
os.execvp('sqlite3', args)
|
||||
|
Loading…
x
Reference in New Issue
Block a user