Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def filterJSON( objarr, filterparam ):
- value = None
- execcode = 'value = [ newobj for newobj in objarr 1==1 '
- for filt in filterparam:
- execcode += "and if %s in newobj and %s %s newobj['%s'] " %filt['filterBy'] %filt['keyword'] %filt['filterType'] %filt['filterBy']
- execcode += ']'
- print( execcode )
- exec( execcode )
- return value
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement