From 489421b01562494ab506de5d30ea97d7b6b5df30 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Sat, 12 Aug 2017 21:06:49 +0200 Subject: Fixed #23546 -- Added kwargs support for CursorWrapper.callproc() on Oracle. Thanks Shai Berger, Tim Graham and Aymeric Augustin for reviews and Renbi Yu for the initial patch. --- docs/releases/2.0.txt | 4 ++++ docs/topics/db/sql.txt | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/releases/2.0.txt b/docs/releases/2.0.txt index c4f5a8147c..1584b87293 100644 --- a/docs/releases/2.0.txt +++ b/docs/releases/2.0.txt @@ -269,6 +269,10 @@ Models * The new ``field_name`` parameter of :meth:`.QuerySet.in_bulk` allows fetching results based on any unique model field. +* :meth:`.CursorWrapper.callproc()` now takes an optional dictionary of keyword + parameters, if the backend supports this feature. Of Django's built-in + backends, only Oracle supports it. + Requests and Responses ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/topics/db/sql.txt b/docs/topics/db/sql.txt index 94e08b8bef..969026e56e 100644 --- a/docs/topics/db/sql.txt +++ b/docs/topics/db/sql.txt @@ -350,10 +350,12 @@ is equivalent to:: Calling stored procedures ~~~~~~~~~~~~~~~~~~~~~~~~~ -.. method:: CursorWrapper.callproc(procname, params=None) +.. method:: CursorWrapper.callproc(procname, params=None, kparams=None) - Calls a database stored procedure with the given name and optional sequence - of input parameters. + Calls a database stored procedure with the given name. A sequence + (``params``) or dictionary (``kparams``) of input parameters may be + provided. Most databases don't support ``kparams``. Of Django's built-in + backends, only Oracle supports it. For example, given this stored procedure in an Oracle database: @@ -372,3 +374,7 @@ Calling stored procedures with connection.cursor() as cursor: cursor.callproc('test_procedure', [1, 'test']) + + .. versionchanged:: 2.0 + + The ``kparams`` argument was added. -- cgit v1.3