Refs #9408: Removed support for passing params as dicts in the oracle backend. Wasn't documented, didn't work, isn't necessary.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9418 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Ian Kelly 2008-11-14 00:54:16 +00:00
parent 8d28a4c853
commit 43b03ba57d
1 changed files with 7 additions and 24 deletions

View File

@ -314,34 +314,17 @@ class FormatStylePlaceholderCursor(Database.Cursor):
charset = 'utf-8'
def _format_params(self, params):
if isinstance(params, dict):
result = {}
for key, value in params.items():
result[smart_str(key, self.charset)] = OracleParam(param, self.charset)
return result
else:
return tuple([OracleParam(p, self.charset, True) for p in params])
return tuple([OracleParam(p, self.charset, True) for p in params])
def _guess_input_sizes(self, params_list):
if isinstance(params_list[0], dict):
sizes = {}
iterators = [params.iteritems() for params in params_list]
else:
sizes = [None] * len(params_list[0])
iterators = [enumerate(params) for params in params_list]
for iterator in iterators:
for key, value in iterator:
if value.input_size: sizes[key] = value.input_size
if isinstance(sizes, dict):
self.setinputsizes(**sizes)
else:
self.setinputsizes(*sizes)
sizes = [None] * len(params_list[0])
for params in params_list:
for i, value in enumerate(params):
if value.input_size: sizes[i] = value.input_size
self.setinputsizes(*sizes)
def _param_generator(self, params):
if isinstance(params, dict):
return dict([(k, p.smart_str) for k, p in params.iteritems()])
else:
return [p.smart_str for p in params]
return [p.smart_str for p in params]
def execute(self, query, params=None):
if params is None: