DavidA escreveu:

> You build up a dynamic "and" query with a term for each checked box in
> the UI. Then you use that compound query to filter your model objects.
> 
> Now that I think about it, since this is an "and" you could also do:
> 
> def my_view(request):
>     query = {}
>     for i in range(1, 13):
>         chk = "var%d" % i
>         if request.has_key(chk) and request[key]:
>             query[chk] = True
> 
>     objects = MyModel.objects.filter(**query)
> 
I would like to thank you all for your help.  I'm using an expression
similar to the above example and it works flawlessly!

Regards,

Luis

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

Reply via email to