(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')
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ [EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss