[sqlalchemy] Generative queries in SA0.3 ?

2007-11-18 Thread exhuma.twn
I have seen that in SA 0.4 on can do something like: q = table.select() q = q.where(x=1) q = q.where(z=2) ... Is this also possible in SA 0.3? I want to build a web-page where a user can refine filters on the go, to perform a drill-down in a data set. Doing this with plain-text SQL is fairly

[sqlalchemy] Re: path based options and contains_eager

2007-11-18 Thread Michael Bayer
On Nov 16, 2007, at 12:29 PM, stephen emslie wrote: I'm a bit confused now, so please tell me if I've got something fundamentally wrong here, otherwise are these bugs? I've got these both fixed with some test coverage in rev 3791...thanks for spotting these !

[sqlalchemy] Re: Generative queries in SA0.3 ?

2007-11-18 Thread Michael Bayer
On Nov 18, 2007, at 11:26 AM, exhuma.twn wrote: I have seen that in SA 0.4 on can do something like: q = table.select() q = q.where(x=1) q = q.where(z=2) ... Is this also possible in SA 0.3? 0.3. can build up selects by using methods such as append_whereclause(). but in 0.3 its not

[sqlalchemy] Re: path based options and contains_eager

2007-11-18 Thread stephen emslie
That was quick! contains_eager with aliases is now giving me exactly what I wanted, which is an eager-loaded subset of the tree at each level. That is going to make a really big difference to my project. Thank you! I'm still seeing a cycle develop with the unaliased options, but I think that

[sqlalchemy] Unnecessary selects when cascade=all, delete-orphane and composite keys

2007-11-18 Thread Anton V. Belyaev
Hello all, I am building a grading system for students and got unexpected performance problems. I am using composite key for marks, which refer to students and subjects. When I am creating a mark (for student_1 and subject_1), unnecessary select operations are performed (select all marks for

[sqlalchemy] Re: Unnecessary selects when cascade=all, delete-orphane and composite keys

2007-11-18 Thread Michael Bayer
On Nov 18, 2007, at 4:54 PM, Anton V. Belyaev wrote: Hello all, I am building a grading system for students and got unexpected performance problems. I am using composite key for marks, which refer to students and subjects. When I am creating a mark (for student_1 and subject_1),

[sqlalchemy] Re: SQLAlchemy 0.4.1 released

2007-11-18 Thread Koen Bok
Thanks Mike. Cool stuff! On Nov 19, 1:26 am, Michael Bayer [EMAIL PROTECTED] wrote: Hello alchemers - This is an awesome release. I'm excited about this one. With our new shiny clean 0.4 codebase, internals are starting to look a lot more intelligent, and new things are becoming

[sqlalchemy] Error with query and joined table inheritance

2007-11-18 Thread Matt
I have some classes that inherit from one another, here are the mappers: mapper(Content, content, polymorphic_on=content.c.type, polymorphic_identity='content') mapper(TvContent, content_tv_metadata, inherits=Content, polymorphic_identity='tv show') mapper(SoftwareContent,

[sqlalchemy] Re: Error with query and joined table inheritance

2007-11-18 Thread Michael Bayer
On Nov 18, 2007, at 10:15 PM, Matt wrote: I have some classes that inherit from one another, here are the mappers: mapper(Content, content, polymorphic_on=content.c.type, polymorphic_identity='content') mapper(TvContent, content_tv_metadata, inherits=Content, polymorphic_identity='tv

[sqlalchemy] Re: Error with query and joined table inheritance

2007-11-18 Thread Matt
Thanks for the insight Michael -- some records in the content table had a 'type' of one of the subclasses, but not a record in the corresponding subclass table -- works like a charm once I insert records for everything in the subclass tables. Matt On Nov 18, 7:58 pm, Michael Bayer [EMAIL