Re: What about union() and intersection()

2006-05-09 Thread Michael Radziej
Luke Plant wrote: > > Now I'm not sure either, looking back at the posts :-) > > Some people (e.g. Joseph) were definitely thinking in terms of doing a > UNION or UNION ALL in SQL. For 'UNION', I think the ORM constrains you > to using a single model, and therefore a single table, in which c

Re: What about union() and intersection()

2006-05-08 Thread Luke Plant
On Monday 08 May 2006 12:17, Michael Radziej wrote: > Sorry for the long delay, your posting confused me about what I want > ;-) > > My original intentions are completely different from Luke's. I really > need a function that builds the union over any list (or any > iterator). Perhaps an example

Re: What about union() and intersection()

2006-05-08 Thread Michael Radziej
Hi, ticket 1803 implements a set like interface for union/intersection, such as aQuerySet.union(otherQuerySet) ticket 1807 implements my original idea under the name list_union, list_intersection, such as QuerySet.union(listOfQuerySets) comments appreciated ;-) Michael --~--~-~--~

Re: What about union() and intersection()

2006-05-08 Thread Michael Radziej
Luke Plant wrote: > On Friday 05 May 2006 12:47, Michael Radziej wrote: >> Hi, >> >> what about providing class functions QuerySet.union(cls, qset_list), >> QuerySet.intersection(cls, qset_list), both returning cls, such as: >> >> def union(cls, qset_list): >> """Returns the union of a list of

Re: What about union() and intersection()

2006-05-05 Thread Luke Plant
On Friday 05 May 2006 12:47, Michael Radziej wrote: > Hi, > > what about providing class functions QuerySet.union(cls, qset_list), > QuerySet.intersection(cls, qset_list), both returning cls, such as: > > def union(cls, qset_list): > """Returns the union of a list of QuerySets, a QuerySet."""

Re: What about union() and intersection()

2006-05-05 Thread Joseph Kocherhans
On 5/5/06, Michael Radziej <[EMAIL PROTECTED]> wrote: > > what about providing class functions QuerySet.union(cls, qset_list), > QuerySet.intersection(cls, qset_list), both returning cls, such as: > > def union(cls, qset_list): > """Returns the union of a list of QuerySets, a QuerySet.""" >

Re: What about union() and intersection()

2006-05-05 Thread Adrian Holovaty
On 5/5/06, Michael Radziej <[EMAIL PROTECTED]> wrote: > what about providing class functions QuerySet.union(cls, qset_list), > QuerySet.intersection(cls, qset_list), both returning cls, such as: > > def union(cls, qset_list): > """Returns the union of a list of QuerySets, a QuerySet.""" >

What about union() and intersection()

2006-05-05 Thread Michael Radziej
Hi, what about providing class functions QuerySet.union(cls, qset_list), QuerySet.intersection(cls, qset_list), both returning cls, such as: def union(cls, qset_list): """Returns the union of a list of QuerySets, a QuerySet.""" return reduce(cls.__or__, qset_list) union = classmethod(un