[sqlalchemy] Re: condition on every query

2014-07-22 Thread mail
I had the same problem and decided to look into implementing a custom relationship like you suggested. I'll post what I have here in case anyone else has the same problem. :) The first thing I noticed was the query_class attribute on the RelationshipProperty class. If you don't want to

[sqlalchemy] Re: Opinion on correct use of Sqlalchemy

2007-04-10 Thread HD Mail
Michael Bayer wrote: On Apr 9, 2007, at 10:06 PM, Huy Do wrote: Michael Bayer wrote: Particularly for your query you are doing an eager load between asset and location yet a lot of your query criterion depends upon location, so in that sense yes you have to use custom SQL, since

[sqlalchemy] Re: About threadlocal strategy

2007-04-10 Thread HD Mail
Koen Bok wrote: I'm trying to wrap my head around the threadlocal plugin to decide if we need it for our app. We are building a GUI point of sale system. Until now I have done everything in sessions, basically in one global shared session. I have read all of the documentation about the

[sqlalchemy] Opinion on correct use of Sqlalchemy

2007-04-07 Thread HD Mail
Hi, I was after some opinions on the following use of SA. 1. Is there any problems using SA in this way ? 2. Is there better ways of achieving this ? My Mapper db.mapper(Asset, db.asset_table, properties = { 'location': relation(Location, lazy=False), 'type':

[sqlalchemy] Re: offset limit on query with relations

2007-04-05 Thread HD Mail
King Simon-NFHD78 wrote: Huy wrote: Hi, When using the generative limit() offset() or order_by calls on mapper query, the sql generated looks weird. I get something like select table1.* table2.* from (select table1a.id from table1a limit 20 offset 0 order by table1.col) as

[sqlalchemy] Re: alias not used with relationship to arbitary select

2007-03-26 Thread HD Mail
I think the issue is you cant put a task_status ordering in your Task mapper since that table is not part of its mapping. http://www.sqlalchemy.org/trac/wiki/ FAQ#ImusinglazyFalsetocreateaJOINOUTERJOINandSQLAlchemyisnotconstructing

[sqlalchemy] Help with saving mapped objects to pylons session

2007-03-22 Thread HD Mail
Hi, I am having problems with saving/restoring mapped objects from a pylons session. I am getting the no attribute on a list attribute (which is a one-many relationship) error when pylons tries to unpickle the object. I've read a previous post where Michael explains why this happens. I have

[sqlalchemy] Re: making crud with assign_mapper

2007-02-07 Thread HD Mail
Hi Iain, I'm working on an admin interface and trying to make it generic when that will do, a la django, but more easily customizable. A couple of things I could not yet find in the SA docs, can anyone point me to the right place or if they know pipe up? - how would one ask a mapper object