[sqlalchemy] Re: postgres table-name length?

2008-06-23 Thread Egil Möller
Someone has recently made this claim without any supporting evidence, and I responded with an example of the compiler/ORM running against Oracle, truncating a long generated name, which had been aliased twice, into a properly truncated name, results returned just fine. This is a very

[sqlalchemy] Re: Problem:maximum recursion depth exceeded

2008-06-23 Thread Marin
I was trying to do something yesterday evening and I found something strange. After running this code: q = Q() for j in range(1): a = A() a.Q = q a.C = WC() I get this graph edges (tuples): import pprint ppp = pprint.PrettyPrinter(indent=4) ppp.pprint([(x.class_,

[sqlalchemy] Re: postgres table-name length?

2008-06-23 Thread az
i've made something but before u jump on my overly generic ways of coding, here the matrix to be tested: matrix/possibilities: A. mangling: for those longer, try 2 of same kind (in one parent), both same size, beginning same but diff. at the end, with diff after MAXLEN, e.g. sometable(

[sqlalchemy] Re: problem with server_default (and/or sa.PassiveDefault in 0.5.beta1

2008-06-23 Thread Werner F. Bruhin
Svilen and Michael, Thanks for all the pointers. Will look into this all and read up some more on declarative (I like its approach, having things together) and do some more test scripts for my application. Werner Michael Bayer wrote: that __repr__ is pretty tortured too; a typical

[sqlalchemy] Re: Problem:maximum recursion depth exceeded

2008-06-23 Thread Michael Bayer
On Jun 23, 2008, at 4:18 AM, Marin wrote: I was trying to do something yesterday evening and I found something strange. After running this code: q = Q() for j in range(1): a = A() a.Q = q a.C = WC() I get this graph edges (tuples): import pprint ppp =

[sqlalchemy] Re: postgres table-name length?

2008-06-23 Thread Michael Bayer
On Jun 23, 2008, at 3:27 AM, Egil Möller wrote: I will make an effort to port them to the latest version before posting them to trac. OKbut I am *really really* curious what the bugs are. It would be better for me to have a look to see what the preferred approach is for them

[sqlalchemy] Item count along object results

2008-06-23 Thread Gaetan de Menten
Hi list, Is there really no easier/nicer way to get a count of items alongside object results than the one described at: http://www.sqlalchemy.org/docs/05/ormtutorial.html#datamapping_joins_subqueries ? from sqlalchemy.sql import func stmt = session.query(Address.user_id,

[sqlalchemy] Re: Item count along object results

2008-06-23 Thread Michael Bayer
On Jun 23, 2008, at 10:27 AM, Gaetan de Menten wrote: Hi list, Is there really no easier/nicer way to get a count of items alongside object results than the one described at: http://www.sqlalchemy.org/docs/05/ormtutorial.html#datamapping_joins_subqueries ? different SQL, or different

[sqlalchemy] Re: postgres table-name length?

2008-06-23 Thread Michael Bayer
On Jun 23, 2008, at 2:16 AM, [EMAIL PROTECTED] wrote: i can make several tests about how the combination of tablename, colname, seqname, indexname alone and some of them in pairs behave around max_single_name_len=64 - below, at and above it. i've no iea about schemas but i guess they can be

[sqlalchemy] Multiple DBs in 0.5

2008-06-23 Thread kris
We have an application (Turbogears) that uses multiple databases. A main (postgres/mysql) database for most data (TG + application) and another datbase (sqlite) used for tracking some file info. The main database uses the standard turbogears session, however we ran into trouble using the

[sqlalchemy] Adding a filter_by() clause by default.

2008-06-23 Thread RommeDeSerieux
In my application, a lot of models have a deleted_at field which is either null or set to a date. And in most places where i select from those models, i only need the instances where deleted_at is null. Of course, i can do it manually by adding just another filter_at on every ORM operation,

[sqlalchemy] Re: postgres table-name length?

2008-06-23 Thread az
On Monday 23 June 2008 18:23:27 Michael Bayer wrote: On Jun 23, 2008, at 2:16 AM, [EMAIL PROTECTED] wrote: i can make several tests about how the combination of tablename, colname, seqname, indexname alone and some of them in pairs behave around max_single_name_len=64 - below, at and above

[sqlalchemy] Re: Multiple DBs in 0.5

2008-06-23 Thread Michael Bayer
On Jun 23, 1:08 pm, kris [EMAIL PROTECTED] wrote: Are we setting up the multiple database situation incorrectly for 0.5? 0.4 had an implicit behavior whereby when you hit the lazy loader on an attribute for an object that was not bound to a session, it would automatically bind to the

[sqlalchemy] Re: Adding a filter_by() clause by default.

2008-06-23 Thread Michael Bayer
using 0.5: from sqlalchemy.orm import Query, sessionmaker class MyQuery(Query): def __new__(cls, entities, **kwargs): if hasattr(entities[0], 'deleted_at'): return Query(entities, **kwargs).filter_by(deleted_at=None) else: return object.__new__(cls)