build the "sql where cause" dynamic

christian ozric at web.de
Mon May 2 03:48:09 EDT 2011


Hi,

from some radio buttons in a django app i concat  string like that:
But have no idea how i get the or when there different values
for a specified p column (# is currently my intended splitter maybe i
can concat a better input?).

input: "p2=1#p2=2#p1=3#p1=1#p1=5#pc=1#py=1"

output: "p2 in ('1','2') and p1 in ('3','1','5') and pc in ('1') and
py in ('1')"


Many thanks for any starting point
Christian



More information about the Python-list mailing list