文件名称:django-humanize:使用人性化的第三方库作为模板过滤器
文件大小:6KB
文件格式:ZIP
更新时间:2024-05-26 05:04:20
Python
django-humanize-使用humanize第三方库作为模板过滤器 Django已经提供了但是该实现缺少一些功能,例如持续时间的人性化。 该库可助您一臂之力,使您可以使用支持的模板过滤器。 安装 将django_humanize添加到您的INSTALLED_APPS设置中。 例子 模板 {% load humanizelib %} It lasted {{ duration|naturaldelta }}. 看法 import datetime from django.shortcuts import render_ def summary(request): context = {'duration': datetime.timedelta(seconds=1000)} return render('template.html', context) 将呈现为“持
【文件预览】:
django-humanize-master
----django_humanize()
--------__init__.py(0B)
--------templatetags()
--------tests()
----LICENSE(1KB)
----setup.cfg(40B)
----setup.py(899B)
----README.md(1KB)
----.gitignore(55B)