Hello,
I have the following filter query which is doing an SQL OR statement:
results = Stores.objects.filter(Q(title__icontains=prefs.address1) | Q(title__icontains=prefs.address2))
This works fine but if the prefs.address1 and prefs.address2 values (which come from another model) are blank in mySQL, Django complains with the following error:
Cannot use None as a query value
Is there an elegant way to check to see if my filter values are not blank before constructing the OR filter query?
Many thanks.