On 12/10/06 9:37 PM, Rares Vernica wrote: > What is a way to get the union of two QuerySets?
See http://www.djangoproject.com/documentation/db_api/#complex-lookups-with-q-objects. > In [6]: a = Person.objects.filter(first_name__startswith='mic') > > In [7]: b = Person.objects.filter(first_name__startswith='joh') Try:: >>> Person.objects.filter( ... Q(first_name__startswith="mic") | ... Q(first_name__startswit="joh") ... ) Jacob --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---