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']))

--

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/web/



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to