I have a queryset it filter by 2 variables
family = ModelsClass.objects.filter(foo=var1).filter(bar=var2)
If var1 and var2 are not null everything work but var1 and var2 can be Null. In this case i need to exclude the Null one.
For example, if var1 is Null it must filter only by var2 and the other way around.
Is there a way to insert an if condition inside the filter queryset or something else?
TY