[Question] Is there any way to get the "filter name" inside the common custom filter function defined against it
cs-satish-mishra opened this issue · comments
I have written generic custom filters.
def common_custom_filter_func(**args, **kwargs):
print(filter name)
And there are many filters with different names are mapped to the same function
{
"filter1": common_custom_filter_func,
"filter2": common_custom_filter_func,
}
Is there any way I can get my filter name inside the filter function when its called? For example, I need to catch the name filter1 inside common_custom_filter_func
when the below template is called. And respectively for filter2
{{ data | filter1 }} ----> prints filter1
{{ data | filter2 }} ----> prints filter2
I tried pass_context but it does not have any attribute that has the caller filter name.