summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-09-25 17:42:51 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2019-09-26 11:26:43 -0400
commitcb9215504c0131facc8ed1b22746d3dc53e628b9 (patch)
tree8d51c54ef23bc5f16c1a775e622bb1ff2d2141b9 /lib/sqlalchemy/orm/base.py
parent48d22c040694bbc00bcd0e343770408648616bb6 (diff)
downloadsqlalchemy-cb9215504c0131facc8ed1b22746d3dc53e628b9.tar.gz
Unify generation between Core and ORM query
generation is to be enhanced to include caching functionality, so ensure that Query and all generative in Core (e.g. select, DML etc) are using the same generations system. Additionally, deprecate Select.append methods and state Select methods independently of their append versions. Mutability of expression objects is a special case only when generating new objects during a visit. Fixes: #4637 Change-Id: I3dfac00d5e0f710c833b236f7a0913e1ca24dde4
Diffstat (limited to 'lib/sqlalchemy/orm/base.py')
-rw-r--r--lib/sqlalchemy/orm/base.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/sqlalchemy/orm/base.py b/lib/sqlalchemy/orm/base.py
index 4d308d26b..e52b6d8bb 100644
--- a/lib/sqlalchemy/orm/base.py
+++ b/lib/sqlalchemy/orm/base.py
@@ -207,12 +207,10 @@ _SET_DEFERRED_EXPIRED = util.symbol("SET_DEFERRED_EXPIRED")
_DEFER_FOR_STATE = util.symbol("DEFER_FOR_STATE")
-def _generative(*assertions):
- """Mark a method as generative, e.g. method-chained."""
-
+def _assertions(*assertions):
@util.decorator
def generate(fn, *args, **kw):
- self = args[0]._clone()
+ self = args[0]
for assertion in assertions:
assertion(self, fn.__name__)
fn(self, *args[1:], **kw)