Re: [sqlalchemy] Problem build a query using just core

2014-09-15 Thread Mike Bernson
Here is simple table def from sqlalchemy import * db = create_engine('sqlite:///test.db') metadata = MetaData(db) trs_transaction = Table("trs_transaction", metadata, Column('transaction_id', Integer(), primary_key=True, autoincrement=True), Column('account', BigInteger(), index=True, n

Re: [sqlalchemy] Problem build a query using just core

2014-09-15 Thread Michael Bayer
if you want to send (simplified, succinct) table defs i can show you how to get that in core. On Sep 15, 2014, at 6:39 PM, Mike Bernson wrote: > Given the table below I am trying to get the where statement built > using just core. I have tried a number of thing and am not able to > get the que

[sqlalchemy] Problem build a query using just core

2014-09-15 Thread Mike Bernson
Given the table below I am trying to get the where statement built using just core. I have tried a number of thing and am not able to get the query built. I can get the query close but not correct. I must be missing something simple. The database is Mysql and SQLAchemy is 9.7 The query does wor

Re: [sqlalchemy] Deferring a many-to-many mapping

2014-09-15 Thread Brian Rossa
Mike, Thanks for the feedback! > > (1) The most visible implementations of vanilla many-to-many mappings > seem to use sqlalchemy.Table(...). Is that, indeed, the accepted practice? > One alternative would be to use a mapped class, but that seems less than > parsimonious. > > all parsimony aside

Re: [sqlalchemy] _listen() got an unexpected keyword argument 'named'

2014-09-15 Thread Michael Bayer
On Sep 15, 2014, at 3:58 AM, Florian Rüchel wrote: > Hi, > > I use events for some of my models to trigger changes and so on. However, one > function needs to be triggered on very different events (attribute, mapper). > To make things easy, I wanted to use named arguments and implement the >

[sqlalchemy] _listen() got an unexpected keyword argument 'named'

2014-09-15 Thread Florian Rüchel
Hi, I use events for some of my models to trigger changes and so on. However, one function needs to be triggered on very different events (attribute, mapper). To make things easy, I wanted to use named arguments and implement the correct logic to retrieve the values I needed. However, when I tr