[Sqlalchemy-tickets] Issue #3498: cascade_iterator doesn't behave as expected for an `all` type_ ,
Brought to you by:
zzzeek
|
From: jvanasco <iss...@bi...> - 2015-07-23 20:47:17
|
New issue 3498: cascade_iterator doesn't behave as expected for an `all` type_ , perhaps it is a literal (not implicit) `all`? https://bitbucket.org/zzzeek/sqlalchemy/issues/3498/cascade_iterator-doesnt-behave-as-expected jvanasco: http://docs.sqlalchemy.org/en/rel_1_0/orm/mapping_api.html?highlight=cascade_iterator#sqlalchemy.orm.mapper.Mapper.cascade_iterator Using this code, I would expect to the cascade for "all" contain all objects instance_state.mapper.cascade_iterator('all', instance_state) instead, I see an empty list. using the defaults, i see what I want instance_state.mapper.cascade_iterator('save-update', instance_state) instance_state.mapper.cascade_iterator('merge', instance_state) I think "all" is filtering for rules that match an explicit `all` cascade, not "all cascades" perhaps a new argument, such as "all_rules" is needed? The docs on the attribute could be better. It seems this returns a generator, of which every element is a tuple in the following form: * [0] orm object * [1] Mapper of [0] * [2] InstanceState of [0] * [3] __dict__ of [0] |