[sqlalchemy] ForeignKeyConstraint error

2013-05-08 Thread Marco De Felice
Hi on sqlalchemy 0.7.4 Using ForeignKeyConstraint it happens that join() or outerjoin() does not find foreign keys while using ForeignKey on field declaration works (see attachment), is this a nomal sa behaviour? Thanks -- You received this message because you are subscribed to the Google

Re: [sqlalchemy] two updates fired when querying related tables?

2010-02-03 Thread Marco De Felice
Michael Bayer ha scritto: Marco De Felice wrote: Hi all This unusual problem appeared today. I have a mapper extension that gets called twice if I do a query on a relate_table while updating properties of a mapped object. I do something like this: myObj = myMappedObject session.begin

Re: [sqlalchemy] two updates fired when querying related tables?

2010-02-03 Thread Marco De Felice
By the way, I just wanted to let you know that while I don't usually use this mailing list, we're on the way to have a gui application used on production that uses sqlalchemy and it all works very well (also considering the little time I have to study SA, I just use it) -- You received this

[sqlalchemy] query on related: speed problems with huge table

2009-05-14 Thread Marco De Felice
Hi I have a huge Agents table with many relations and a Orders table with agent field related via r_agent to Agents. When I filter like orders.r_agent.has(Agents.name.ilike(test)) the query is too slow. I came up with creating a view Agents_small on the database Agents table whith only a few

[sqlalchemy] Re: query on related: speed problems with huge table

2009-05-14 Thread Marco De Felice
Michael Bayer ha scritto: Is the solution that you created a new table which is receiving a copy of some rows (essentially materialized view) ? otherwise I don't see what is allowing a speed change. Thanks, that confirms my suspects. There's some problem elsewhere in my code.

[sqlalchemy] Re: filter Association and order the union via Orm?

2008-10-06 Thread Marco De Felice
Michael Bayer wrote: the most straightforward way is to have Parent/Child descend from a common base class and use concrete table inheritance in conjunction with polymorphic_union, as described in :

[sqlalchemy] filter Association and order the union via Orm?

2008-10-03 Thread Marco De Felice
given the structure below (pasted from SA 0.5 docs of association object): left_table = Table('left', metadata, Column('id', Integer, primary_key=True), Column('l_data', String(50)) right_table = Table('right', metadata, Column('id', Integer, primary_key=True), Column('r_data',

[sqlalchemy] 0.4 to 0.5 beware of session.close ?

2008-08-22 Thread Marco De Felice
While migrating I came across the following sequence of actions, I had some old code that called session.close() elsewhere in the application and also I tend to use sqlalchemy as a temporary object cache knowing this is somewhat discouraged. Anyway is it correct that nothing happens when calling

[sqlalchemy] Audit log client side

2008-02-22 Thread Marco De Felice
Hi I'm thinking about a simple client side table audit with SA. Given the audit log pattern: http://martinfowler.com/ap2/auditLog.html wouldn't it be simple to adapt it to a mapped class? I was thinking of a log() function inside the mapped class that if called saves data into a second table

[sqlalchemy] SA 0.4 orm mapped class 'instrumentation time'

2007-08-30 Thread Marco De Felice
Michael Bayer ha scritto: its most likely uncompiled mappers. the c attribute on the class is deprecated; use Table.attribute instead. ... Thanks, but it seems the Table.c.attribute has a .op() method that I can't find on Table.attribute

[sqlalchemy] SA 0.4 orm mapped class 'instrumentation time'

2007-08-29 Thread Marco De Felice
With SA 0.4beta4 if I try to access a mapped object field (Table.c.fieldname) before any query has been sent to the database the call fails with a AttributeError(key). Everything works if I do this after having issued a query. -- Example: (skip to the __main__ section) import sqlalchemy as sqa

[sqlalchemy] doing a one() on a unique key

2007-07-20 Thread Marco De Felice
Hi all for my first post I'm using the new one() method like this: query(Table).filter_by(and_(Table.c.field1 == val1, Table.c.field2 == val2)).one() filed1 + field2 has a unique constraint in Table, so there won't never be more than one row returned, but there may be none. When there's none I