In my template, I use multiple filters as below :
story|force_escape|markdown|nlToBr
I use this flow of filter many times in my page and I would like to create a filter that use those three filters. Is there a way to do eat easily or do I have to find the code of each filter and copy paste back to back in on single custom filter ?
Thank you very much ! Dorian
Filters are just functions; you can call them inside your own filter.
from ... import ...
@register.filter
def combo(value):
return force_escape(markdown(nlToBr(value)))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With