python - ValueError: too many values to unpack, passing a list as *args -


i have problem passing arguments through list django filter. here code:

args = [ "q( title__icontains = 'foo' ) | q( author__icontains = 'foo' )", "q( title__icontains = 'bar' ) | q( author__icontains = 'bar' )" ] entries = book.objects.filter( *args ) 

but filter returns error:

valueerror: many values unpack,

your args strings, must q objects. remove quotes around q object definitions.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -