用于自定义Crispy窗体布局的有用模板的集合。
crispy-templates的Python项目详细描述
=========
酥脆的模板图片::https://badge.fury.io/py/crispy templates.png
:目标:https://badge.fury.io/py/crispy templates
自定义crispy表单布局的有用模板集合。
https://crispy templates.readthedocs.io.
quickstart
----
crispy模板依赖于[crispy forms](https://github.com/django crispy forms/django crispy forms django crispy forms),确保您已经正确安装了crispy forms。
install crispy templates::
将其添加到“已安装的应用程序”中:
。代码块::python
installed_apps=(
…
“crispy_templates.apps.crispytemplatesconfig”,
…
)
在“crispy forms.helper.formhelper”对象中定义布局模板:
。代码块::python
from crispy_forms.helper import formhelper
from crispy_forms.layout导入字段,layout
class bookform(forms.modelform):
def初始(self,*args,**kwargs):
super(bookform,self)。\uu初始(args,**kwargs)
self.helper=formhelper()
self.helper.template懔u pack=“bootstrap3”
self.helper.layout=layout(
field('publication懔status',template=“crispy懔templates/layouts/radio懔tu field.html”),
)
通过运行“python manage.py collectstatic”添加javascript,然后将其包含在模板中:
……代码块::python
{%static'crispy-templates/js/crispy-templates.js%}
最好将其添加到页面的页脚,以免延迟页面加载。
**注意**-目前仅支持“crispy-forms”附带的“bootstrap3”模板包。
credits
----
包装:
*cookiecutter\u
*`cookiecutter djangopackage`\u
…_ Cookiecutter:https://github.com/audreyr/Cookiecutter
。_` Cookiecutter DjangoPackage`:https://github.com/pydanny/Cookiecutter DjangoPackage
----
<0.2.0(2017-01-17)
+++++++++++++覆盖
*更新的文档
>0.1.0(2017-01-14)
++++++++++++
酥脆的模板图片::https://badge.fury.io/py/crispy templates.png
:目标:https://badge.fury.io/py/crispy templates
自定义crispy表单布局的有用模板集合。
https://crispy templates.readthedocs.io.
quickstart
----
crispy模板依赖于[crispy forms](https://github.com/django crispy forms/django crispy forms django crispy forms),确保您已经正确安装了crispy forms。
install crispy templates::
将其添加到“已安装的应用程序”中:
。代码块::python
installed_apps=(
…
“crispy_templates.apps.crispytemplatesconfig”,
…
)
在“crispy forms.helper.formhelper”对象中定义布局模板:
。代码块::python
from crispy_forms.helper import formhelper
from crispy_forms.layout导入字段,layout
class bookform(forms.modelform):
def初始(self,*args,**kwargs):
super(bookform,self)。\uu初始(args,**kwargs)
self.helper=formhelper()
self.helper.template懔u pack=“bootstrap3”
self.helper.layout=layout(
field('publication懔status',template=“crispy懔templates/layouts/radio懔tu field.html”),
)
通过运行“python manage.py collectstatic”添加javascript,然后将其包含在模板中:
……代码块::python
{%static'crispy-templates/js/crispy-templates.js%}
最好将其添加到页面的页脚,以免延迟页面加载。
**注意**-目前仅支持“crispy-forms”附带的“bootstrap3”模板包。
credits
----
包装:
*cookiecutter\u
*`cookiecutter djangopackage`\u
…_ Cookiecutter:https://github.com/audreyr/Cookiecutter
。_` Cookiecutter DjangoPackage`:https://github.com/pydanny/Cookiecutter DjangoPackage
----
<0.2.0(2017-01-17)
+++++++++++++覆盖
*更新的文档
>0.1.0(2017-01-14)
++++++++++++