I have a model where I can set expire_date_1 and expire_date_2. And 2 filters like this.
filter_1 = Q(expire_date_1__isnull=False) & Q(expire_date_1__lte=after_30days)
filter_2 = Q(expire_date_2__isnull=False) & Q(expire_date_2__lte=after_30days)
I want to filter the model that if expire_date_2 is not null then using filter_2 else use filter_1 I tried it to do with Case and When but I can't filter in a When function, can I?