[sqlalchemy] Re: Mapper with relation/custom join condition fails

2007-06-19 Thread Christoph Haas
On Tue, Jun 19, 2007 at 02:21:51AM +0300, [EMAIL PROTECTED] wrote: Perfectly. Although all the hassle makes me think even harder if there is really no other way of connecting these two database tables. A casted join with string comparison gets dirtier every time I look at it. :( excuse

[sqlalchemy] Re: Mapper with relation/custom join condition fails

2007-06-19 Thread svilen
Perfectly. Although all the hassle makes me think even harder if there is really no other way of connecting these two database tables. A casted join with string comparison gets dirtier every time I look at it. :( excuse me if it sounds dumb... what about a middleman table of

[sqlalchemy] Re: postgresql: need schema-qualified foreign keys

2007-06-19 Thread klaus . barthelmann
This looks like a good solution. I'll need some time to provide a test case, however. If the change breaks existing code, how are cross-schema references supposed to be handled? Best regards Klaus On 18 Jun., 21:54, Michael Bayer [EMAIL PROTECTED] wrote: On Jun 18, 2007, at 4:25 AM, [EMAIL

[sqlalchemy] Re: UniqueObject recipe and turbogears

2007-06-19 Thread King Simon-NFHD78
The way to hook most parts of the ORM is by creating a MapperExtension http://www.sqlalchemy.org/docs/adv_datamapping.html#advdatamapping_exte nding. Basically, define a subclass of MapperExtension, overriding whichever method you are interested in (possibly append_result or create_instance in

[sqlalchemy] Re: MSSQL: using pyODBC

2007-06-19 Thread che
hmm it gives with use_scope_identity=False and r2746: File /home/stefanb/src/hor/sqlalchemy/engine/strategies.py, line 106, in create raise TypeError(Invalid argument(s) %s sent to create_engine(), using configuration %s/%s/%s. Please check that the keyword arguments are appropriate for

[sqlalchemy] Checking for number of related items

2007-06-19 Thread Andreas Jung
I have a mapper defined as mapper(HierNode, HierTable, properties={ 'tools' : relation(ToolNode), }) Usually I am interested in iterating over all 'tools' and lazy loading works fine. However sometimes I need to determine if one HierNode has tools or not. Loading all tools would be too

[sqlalchemy] Re: MSSQL: using pyODBC

2007-06-19 Thread che
shame on me I omit your ...addng the keyword parameter..., i.e. db_mssql = create_engine( 'mssql://sa:[EMAIL PROTECTED] use_scope_identity=1', module= pyodbc) unfortunately with scope identity it crashes earlier - mssql.py returns None for id and rollbacks. best regards stefan

[sqlalchemy] session.clear() not clearing cascaded items?

2007-06-19 Thread svilen
g'day i have Links, pointing to Nodes. Adding just Links to session + flush() works as expected - both Links and Nodes got saved. Doing session.close() although does not always detach all related objects, i.e. sometimes some Nodes stay with _session_id on them after session is long gone.

[sqlalchemy] Re: multiple mappers on une table problem.

2007-06-19 Thread Jonathan Ellis
On 6/11/07, Michael Bayer [EMAIL PROTECTED] wrote: secondly: a non-primary mapper is just an awkward way of defining an ORM query. Since we support generative queries now, you can just make a Query object with the criterion youre looking for and just hold onto it...youre just adding a single

[sqlalchemy] Re: multiple mappers on une table problem.

2007-06-19 Thread Michael Bayer
On Jun 19, 2007, at 1:43 PM, Jonathan Ellis wrote: On 6/11/07, Michael Bayer [EMAIL PROTECTED] wrote: secondly: a non-primary mapper is just an awkward way of defining an ORM query. Since we support generative queries now, you can just make a Query object with the criterion youre looking

[sqlalchemy] Re: Performing read-only operations without a session (avoiding leaks)

2007-06-19 Thread Mike Orr
On 6/15/07, Michael Bayer [EMAIL PROTECTED] wrote: create_session().query(Whatever).filter(...).all() You added .all() when I wasn't looking? :) -- Mike Orr [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[sqlalchemy] Re: Performing read-only operations without a session (avoiding leaks)

2007-06-19 Thread Michael Bayer
On Jun 19, 3:50 pm, Mike Orr [EMAIL PROTECTED] wrote: On 6/15/07, Michael Bayer [EMAIL PROTECTED] wrote: create_session().query(Whatever).filter(...).all() You added .all() when I wasn't looking? :) -- Mike Orr [EMAIL PROTECTED] if its not there i need to add it since id like to get