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 -

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

Why does a .NET 4.0 program produce a system.unauthorizedAccess error on a Windows Server 2012 machine with .NET 4.5 installed? -