Temp. fix for ticket #71

This commit is contained in:
tonio
2010-06-18 17:34:53 +02:00
parent ee03742e3f
commit ac7ae13dac
2 changed files with 8 additions and 4 deletions
+6 -1
View File
@@ -13,13 +13,18 @@ def mysql_newconnection(host, dbname, login, password):
return MySQLdb.connect(host=host, db=dbname, user=login, passwd=password)
def getconnection(name):
if not name in connections.keys():
# if not name in connections.keys():
if True:
from django.conf import settings
cfg = settings.DB_CONNECTIONS[name]
if cfg["driver"] == "mysql":
conn = mysql_newconnection(cfg["host"], cfg["dbname"], cfg["login"],
cfg["password"])
if connections.has_key(name):
close(connections[name])
connections[name] = conn
return connections[name]