summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/crud.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-09-13 11:39:47 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-09-16 12:52:25 -0400
commitaed2324b4de3c4f3e6cc7f801fc8ddd8e2d9012b (patch)
treee182b5f7b2396c980a42621e1d2cf1a962dd9c67 /lib/sqlalchemy/sql/crud.py
parentd8cddf61f9de1570257c575a149738ecec6a9d91 (diff)
downloadsqlalchemy-aed2324b4de3c4f3e6cc7f801fc8ddd8e2d9012b.tar.gz
Add multivalued insert context for defaultsreview/mike_bayer/ticket_4075
Added a new method :class:`.DefaultExecutionContext.current_parameters` which is used within a function-based default value generator in order to retrieve the current parameters being passed to the statement. The new function differs from the ``.current_parameters`` attribute in that it also provides for optional grouping of parameters that correspond to a multi-valued "insert" construct. Previously it was not possible to identify the subset of parameters that were relevant to the function call. Change-Id: I6894c7b4a2bce3e83c3ade8af0e5b2f8df37b785 Fixes: #4075
Diffstat (limited to 'lib/sqlalchemy/sql/crud.py')
-rw-r--r--lib/sqlalchemy/sql/crud.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/crud.py b/lib/sqlalchemy/sql/crud.py
index 5739c22f9..8421b1e66 100644
--- a/lib/sqlalchemy/sql/crud.py
+++ b/lib/sqlalchemy/sql/crud.py
@@ -395,7 +395,10 @@ def _create_update_prefetch_bind_param(compiler, c, process=True, name=None):
class _multiparam_column(elements.ColumnElement):
+ _is_multiparam_column = True
+
def __init__(self, original, index):
+ self.index = index
self.key = "%s_m%d" % (original.key, index + 1)
self.original = original
self.default = original.default