2006/3/1, Jan Rademaker <[EMAIL PROTECTED]>: > > aaloy wrote: > > I'm trying to make a dynamic lookup filter depending on the parameters > > that the user inputs on a web search. > > > > That is, I have three optional search fields and I wan't to be able to > > make a lookup search on my database withot having to code all the > > search options. Something like: > > > > search={} > > if searchcriteria1: > > search['field1__exact']=searchcriteria1 > > if searchcriteria2: > > search['field2__contains']=searchcriteria2 > > if searchcriteria3: > > search['linkfield__id__pk']=searchcriteria3 > > > > mytable.get_list(search) > > > > Replace that last line with: > > mytable.get_list(**search)
I'll try thanks! Actually what I have done is use the where keyword, but this forces me to use the real field names of the table and I don't like very much. I should be another, perhaphs more pythonic, solution to be able to create run time search conditions and pass them to the django model. -- Antoni Aloy López Binissalem - Mallorca Soci de Bulma --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---