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
Post a Comment