mirror of https://github.com/django/django.git
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:
parent
8d28a4c853
commit
43b03ba57d
|
@ -314,33 +314,16 @@ 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])
|
||||
|
||||
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:
|
||||
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]
|
||||
|
||||
def execute(self, query, params=None):
|
||||
|
|
Loading…
Reference in New Issue