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(union)
A class method, since you might want to subclass QuerySet (I do).
I found myself needing this a lot, and I think this might be nice for
everyone. If you like the idea, I'll provide the patch.
Michael
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---