I want to be able to use this filter for "specific" or "null" or "any value" scenarios
# 3 scenarios for the third field : Col3
# Query for a specific value
sample = table.objects.filter(Col1=343, Col2=545, Col3=656)
# Query for NULL value
sample = table.objects.filter(Col1=343, Col2=545, Col3=None)
# Query for any value
sample = table.objects.filter(Col1=343, Col2=545, Col3=???)
Specific and NULL scenarios are handled by exact values like 656 and "None" in python. How do we handle ANY value scnearios from above ?
Imagine 3 drop down boxes based on which we can query the database.
My question is similar to this one, but specific to Django
original sql specific question is here: How do you query an int column for any value? , coloumn in my case can be of any type
resulting query might look something like this:
// Query for a specific value
select Col1,Col2,Col3 from table where Col1=343, Col2=545, Col3=656
// Query for NULL value
select Col1,Col2,Col3 from table where Col1=343, Col2=545, Col3 IS NULL
// Query for any value
select Col1,Col2,Col3 from table where Col1=343, Col2=545, Col3=*
Col3__in=[656, None]?