diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-11 03:10:17 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-11 03:10:17 -0500 |
commit | b88c54f95be3e3bc2e0923181d56862fa3fda9fa (patch) | |
tree | eeb695bd9927895537d25a4402bad51b116c6964 /lib/sqlalchemy/engine/base.py | |
parent | 4fa0ea584248726b164008cb8e4257d207b03af9 (diff) | |
parent | 9c0755640c5f1d45596ff7234d2d42f1c92d09e0 (diff) | |
download | sqlalchemy-b88c54f95be3e3bc2e0923181d56862fa3fda9fa.tar.gz |
do the mercurial dance (re-merge what I just merged...)
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r-- | lib/sqlalchemy/engine/base.py | 49 |
1 files changed, 17 insertions, 32 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index a335b1d17..00aaca01e 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -629,24 +629,6 @@ class ExecutionContext(object): raise NotImplementedError() - def last_inserted_params(self): - """Return a dictionary of the full parameter dictionary for the last - compiled INSERT statement. - - Includes any ColumnDefaults or Sequences that were pre-executed. - """ - - raise NotImplementedError() - - def last_updated_params(self): - """Return a dictionary of the full parameter dictionary for the last - compiled UPDATE statement. - - Includes any ColumnDefaults that were pre-executed. - """ - - raise NotImplementedError() - def lastrow_has_defaults(self): """Return True if the last INSERT or UPDATE row contained inlined or database-side defaults. @@ -2467,6 +2449,7 @@ class ResultProxy(object): did not explicitly specify returning(). """ + if not self.context.isinsert: raise exc.InvalidRequestError( "Statement is not an insert() expression construct.") @@ -2475,31 +2458,33 @@ class ResultProxy(object): "Can't call inserted_primary_key when returning() " "is used.") - return self.context._inserted_primary_key + return self.context.inserted_primary_key @util.deprecated("0.6", "Use :attr:`.ResultProxy.inserted_primary_key`") def last_inserted_ids(self): """Return the primary key for the row just inserted.""" return self.inserted_primary_key - + def last_updated_params(self): - """Return ``last_updated_params()`` from the underlying - ExecutionContext. - - See ExecutionContext for details. + """Return the collection of updated parameters from this + execution. + """ - - return self.context.last_updated_params() + if self.context.executemany: + return self.context.compiled_parameters + else: + return self.context.compiled_parameters[0] def last_inserted_params(self): - """Return ``last_inserted_params()`` from the underlying - ExecutionContext. - - See ExecutionContext for details. + """Return the collection of inserted parameters from this + execution. + """ - - return self.context.last_inserted_params() + if self.context.executemany: + return self.context.compiled_parameters + else: + return self.context.compiled_parameters[0] def lastrow_has_defaults(self): """Return ``lastrow_has_defaults()`` from the underlying |