Re: [sqlalchemy] session.execute() list of params with nullable fields

2015-01-19 Thread Michael Bayer
the first entry in the list of parameters determines how the INSERT statement will be written. if you have different sets of keys in each parameter set, then you should invoke session.execute() individually for each set of parameters. Pavel Aborilov abori...@gmail.com wrote: Hi! I have

Re: [sqlalchemy] session.execute() list of params with nullable fields

2015-01-19 Thread Pavel Aborilov
I understood, but it's not obvious, for me. Is it mentioned in the docs? On Monday, January 19, 2015 at 4:47:18 PM UTC+3, Michael Bayer wrote: the first entry in the list of parameters determines how the INSERT statement will be written. if you have different sets of keys in each

Re: [sqlalchemy] session.execute() list of params with nullable fields

2015-01-19 Thread Michael Bayer
yes: http://docs.sqlalchemy.org/en/rel_0_9/core/tutorial.html#executing-multiple-statements When executing multiple sets of parameters, each dictionary must have the same set of keys; i.e. you cant have fewer keys in some dictionaries than others. This is because the Insert statement is

[sqlalchemy] session.execute() list of params with nullable fields

2015-01-19 Thread Pavel Aborilov
Hi! I have model with nullable fields and try to add bulk of items: insert = model.__table__.insert() session.execute(insert, events) where events in the list of dicts with params and if first element in list don't have that nullable params, then event if other elements have one, they won't be

Re: [sqlalchemy] session.execute() list of params with nullable fields

2015-01-19 Thread Pavel Aborilov
Oh, sorry, didn't find that. пн, 19 янв. 2015, 19:06, Michael Bayer mike...@zzzcomputing.com: yes: http://docs.sqlalchemy.org/en/rel_0_9/core/tutorial.html# executing-multiple-statements When executing multiple sets of parameters, each dictionary must have the same set of keys; i.e. you