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 -

excel vba - VBA Proxy auto-configuration for http requests -

php - phpWord - Tables with borders in headers/footers -