Re: [sqlalchemy] Sqlalchemy sintax for a query with "not like" operator

2013-09-29 Thread pyArchInit ArcheoImagineers
Wow Michael, this syntax is very powerfull! Two questions before I can make mistakes: 1 - the number 100 is recovered by something like len(value_list)-1, where value_list contains alls the values I want to search? 2 - id_rec for id_rec: I must to pass this in the same way you wrote? Thanks a l

Re: [sqlalchemy] Sqlalchemy sintax for a query with "not like" operator

2013-09-29 Thread Michael Bayer
On Sep 29, 2013, at 10:56 AM, pyArchInit ArcheoImagineers wrote: > Hi to all. > I try to use the code in this way (query LIKE with OR operator) > > res = > session.query(MAPPER).filter(or_(MAPPER.field.contains('Value1'),MAPPER.field.contains('Value2'), > MAPPER.field.contains('Value3'),MAPP

Re: [sqlalchemy] Using session.execute to bulk-insert into MySQL

2013-09-29 Thread Michael Bayer
On Sep 29, 2013, at 8:41 AM, Roman Iten wrote: > Hi > > I started a pyramid project using the alchemy scaffold (includes > ZopeTransactionExtension to scope sessions to requests, see [1]). > > Trying to insert many 'shots' into a MySQL database with a single SQL > statement, I implemented th

Re: [sqlalchemy] Re: Sqlalchemy sintax for a query with "not like" operator

2013-09-29 Thread pyArchInit ArcheoImagineers
Hi to all. I try to use the code in this way (query LIKE with OR operator) res = session.query(MAPPER).filter(or_(MAPPER.field.contains('Value1'), MAPPER.field.contains('Value2'), MAPPER.field.contains('Value3'),MAPPER .field.contains('Value4'))) With a small dataset, I found the records I want,

[sqlalchemy] Using session.execute to bulk-insert into MySQL

2013-09-29 Thread Roman Iten
Hi I started a pyramid project using the alchemy scaffold (includes ZopeTransactionExtension to scope sessions to requests, see [1]). Trying to insert many 'shots' into a MySQL database with a single SQL statement, I implemented the following view: DBSession = scoped_session( sessionmak