On 12/23/06, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
On 23-Dec-06, at 9:48 AM, Russell Keith-Magee wrote: > Use Q objects to OR three queries together. > > Model.objects.filter(Q(name__startswith='a') | Q(name_startswith='b') > | Q(name_startswith='c')) got this from #django: list=Model.objects.filter(reduce(operator.or_,[Q (name__startwith=letter) for letter in 'abc']))
Same result, different composition. Personally, given Guido's predisposition to eliminating reduce() in Python 3000 [1], I'd be avoiding using reduce in new code. [1] http://www.artima.com/weblogs/viewpost.jsp?thread=98196 Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---