James Bennett wrote:
> Doing NodeEvent.objects.filter(**kwargs) should work
                                  ^^
I was passing it in without the **; arrgggghhh....

anyway this the idiom I ended up with for a different model:

[[[
     if request.has_key('q'): # GET form
         new_data = request.GET.copy()
         errors = manip.get_validation_errors(new_data)
         if not errors:
             kwargs ={}
             # filter strings
             for key in ["sref","seqno","seqno","mid", "cid"]:
                val =  request[key]
                if val.strip() != "":
                    kwargs["%s__exact"%key]=val
             # filter choices/fks: -1 means 'any'
             for key in ["role","source","dest","mtype"]:
                val =  request[key]
                if val.strip() != "" and val.strip() != "-1":
                    kwargs["%s__exact"%key]=int(val)
             results  = Message.objects.filter(**kwargs)
             print "results: ", results
             ...
]]]

cheers
Bill

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