On Tuesday 05 December 2006 23:05, Oleg Broytmann wrote: > (Returning to the list...) > > On Tue, Dec 05, 2006 at 10:42:41PM +0100, Diez B. Roggisch wrote: > > Lets consider this hierarchy: > > > > class A: > > pass > > > > class B(A) > > pass > > > > class C(B) > > pass > > > > class D(B) > > pass > > > > class E(A): > > pass > > > > > > Now I have a page that shows all A, using > > > > A.select([some_filter_criteria]) > > > > Then the user can then select to e.g. only show C and E objects. > > > > So - what I need is a way to filter for the type of an object. So > > C.select() and E.select() isn't exactly what I want. Because then I'd > > have to recombine the results, including application of sorting criteria > > - instead of a single select that generates sql like this > > > > select ... from A, B, C, D, E where [join all tables by ids] and > > (B.childName = 'C' or A.childName = 'E') > > Soemthing like this: > > A.select(A.q.childName=='B' && B.q.childName=='C') > A.select(A.q.childName=='B' && B.q.childName=='C' && C.q.childName=='D' && > D.q.childName=='E')
Unfortunately, that is not working for me. Passing C.q.childName will create a clause that reads a.child_name. I'm digging into this - but if there is another solution, like creating explicit table aliases to B and joining them with A.id = B.id and then doing B.child_name = 'C' I'd be very happy. -- >> Diez B. Roggisch >> Developer T +49 (30) 443 50 99 - 27 F +49 (30) 443 50 99 - 99 M +49 (179) 11 75 303 E [EMAIL PROTECTED] >> artnology GmbH A Milastraße 4 / D-10437 Berlin T +49 (30) 443 50 99 - 0 F +49 (30) 443 50 99 - 99 E [EMAIL PROTECTED] I http://www.artnology.com ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss