Here I am going to write a dynamic filter. This filter is made for python 3. It will take query or model class and filter condition as input, It will return filtered query based on those filter condition. This is constructed using this SO answer. Function class DynamicFilter(ModelHelper): def __init__(self, query=None, model_class=None, filter_condition=None): super().