i've got problems with joinedload on a to-many property which is mapped as lazy='dynamic'. my query is
> runs = test.runs.options(joinedload(TestRun.questions)) (here, test.runs is a lazy='dynamic' property itself, but the important lazy='dynamic' is TestRun.questions.) if i don't set lazy on TestRun's relationship (it's inside the backref, but i suppose this does not matter), everything works as expected. as soon as i set TestRun.questions with lazy='dynamic', the query is still shown in the debug output as > ... FROM test_run LEFT OUTER JOIN test_run_question AS test_run_question_1 > ON ... but when iterating over the result, i get > File "myfile.py", line 63, in myfunction > for run in runs: > File "/usr/lib/pymodules/python2.5/sqlalchemy/orm/query.py", line 1516, in > instances > rows = [process[0](row, None) for row in fetch] > File "/usr/lib/pymodules/python2.5/sqlalchemy/orm/mapper.py", line 1922, in > _instance > populate_state(state, dict_, row, isnew, only_load_props) > File "/usr/lib/pymodules/python2.5/sqlalchemy/orm/mapper.py", line 1809, in > populate_state > populator(state, dict_, row) > File "/usr/lib/pymodules/python2.5/sqlalchemy/orm/strategies.py", line > 1108, in new_execute > 'append_without_event') > File "/usr/lib/pymodules/python2.5/sqlalchemy/util.py", line 1205, in > __init__ > self._data_appender = getattr(data, via) > AttributeError: 'list' object has no attribute 'append_without_event' is this supposed to work, and if yes, how can i find out why it does not? thanks chrysn -- There's always a bigger fish. -- Qui-Gon Jinn
signature.asc
Description: Digital signature