用于https://github.com/anutron/behavior integration with django的实用程序。
django-mootools-behavior的Python项目详细描述
与django集成的https://github.com/anutron/behavior实用程序。
此应用程序提供可以更改表单数据属性的模板筛选器 行为所需的字段。它也有“行为”和“行为更多” 与django.contrib.staticfiles捆绑使用的库。
执照是麻省理工学院的。
安装
pip install django-mootools-behavior
配置
- 将“mootools\u behavior”添加到已安装的应用程序中;
- (可选)运行python manage.py collectstatic以获取“行为” javascript文件;
- 在html中包含必要的js并使用提供的模板过滤器 以设置窗体元素的属性。
过滤器
行为
将“数据行为-…”属性设置为表单字段:
{% load mootools_behavior %} <!-- data-behavior:"OverText" will be added to input field --> {{ form.title|behave:"OverText" }}
设置数据
设置HTML5数据属性(http://ejohn.org/blog/html-5-data-attributes/)。
示例:
{% load mootools_behavior %} <!-- data-behavior:"OverText" will be added to input field --> {{ form.title|set_data:"behavior:OverText" }}
贡献
如果你发现了一个bug,实现了一个特性或者有一个建议, 请不要犹豫与我联系,提出问题或发送请求。
源代码:
- https://bitbucket.org/kmike/django-mootools-behavior/
- https://github.com/kmike/django-mootools-behavior/
报告错误: