Anywhere, I mean models.py, views.py or even a new file called filters.py. Because you will use this filter in views.py so that you can import filters everywhere in your project. For me, I think the filters.py file in the application is the best place.
So in your view.py import the filters like this:
from .filters import ProductFilter