something like this works for me... q = Q( tag__name=first_tag ) for tag in other_tags: q = q | Q( tag__name=tag )
Model.objects.filter( q ) On 4/2/07, Christian Hoppner <[EMAIL PROTECTED]> wrote: > > Hi there! > > I've been thinking about including in my new app a kind of tag browser. The > url is meant to be in the form of tags/A+B+C. > > Of course I know I can use OR queries for this kind of stuff... When the query > string is constructed manually (as a string), I could simply get the tags > from the param, and add them up with OR inbetween until there's no more tags > to add. > > But how do we tackle this with an ORM inbetween? > -- > Chris M. Hoeppner > Web designer, developer & consultant > Faithful Standartista > > > > -- Honza Kr�l E-Mail: [EMAIL PROTECTED] ICQ#: 107471613 Phone: +420 606 678585 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---