开发者

How can I override Django filter

开发者 https://www.devze.com 2023-03-07 04:42 出处:网络
I want to override timesin开发者_如何学JAVAce Django\'s template filter for creating a more efficient filter for getting relative times.

I want to override timesin开发者_如何学JAVAce Django's template filter for creating a more efficient filter for getting relative times.

How can I do it?


You can also create your own filter to do what you want: http://docs.djangoproject.com/en/dev/howto/custom-template-tags/


Monkeypatch django.utils.timesince.timesince with your desired function.

0

精彩评论

暂无评论...
验证码 换一张
取 消