django inplaceedit与bootstrap的集成
django-inplaceedit-bootstrap的Python项目详细描述
内容
django-inplaceedit-bootstrap
Information
django-inplaceedit与bootstrap 3的集成
它是根据GNU Lesser General Public License的条件分布的。
如果没有Tyrdall的帮助,这个蛋是不可能的
Requirements
- django-inplaceedit (== 1.4.1)
- Bootstrap (== 3.3.5)
- django-inplace-edit-extra-fields (== 0.6.1, optional but recommended)
- django-bootstrap3-datetimepicker (== 2.2.3, optional but recommended)
Demo (this video use a very old version of django-inplaceedit and django-inplaceedit-extra-fields)
视频演示,共django-inplaceedit、django-inplaceedit-extra-fields和django-inlinetrans(设置全屏模式以正确查看)
attention:此演示不是此包的演示,在此视频中没有任何与引导无关的提示。请使用testing django project查看演示。
Installation
安装django-inplaceedit egg(1.4.1)
安装django-inplaceedit-extra-fields egg(0.6.1,这是可选的,但推荐)
在安装django-bootstrap3-datetimepicker egg(2.2.3,这是可选的,但推荐)
In your settings.py
INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', #.....................# 'inplaceeditform_bootstrap', # it is very important that this app is before that inplaceeditform and inplaceeditform_extra_fields 'inplaceeditform', 'inplaceeditform_extra_fields', # this is optional but recommended 'bootstrap3_datetime', # this is optional but recommended ) ... # Optional, but recommended ADAPTOR_INPLACEEDIT = {} if 'inplaceeditform_extra_fields' in INSTALLED_APPS: ADAPTOR_INPLACEEDIT['tiny'] = 'inplaceeditform_extra_fields.fields.AdaptorTinyMCEField' # You can add the other adaptors of inplaceeditform_extra_fields # https://pypi.python.org/pypi/django-inplaceedit-extra-fields#installation if 'bootstrap3_datetime' in INSTALLED_APPS: ADAPTOR_INPLACEEDIT['date'] = 'inplaceeditform_bootstrap.fields.AdaptorDateBootStrapField' ADAPTOR_INPLACEEDIT['datetime'] = 'inplaceeditform_bootstrap.fields.AdaptorDateTimeBootStrapField' INPLACEEDIT_EDIT_TOOLTIP_TEXT = 'Please doubleclick to edit'
如果需要,可以使用不同的键在设置中注册这些字段:
... if 'bootstrap3_datetime' in INSTALLED_APPS: ADAPTOR_INPLACEEDIT['date_bootstrap'] = 'inplaceeditform_bootstrap.fields.AdaptorDateBootStrapField' ADAPTOR_INPLACEEDIT['datetime_bootstrap'] = 'inplaceeditform_bootstrap.fields.AdaptorDateTimeBootStrapField'
之后,要想使用特定的适配器,可以将其传递给templateTag,例如:
{% inplace_edit "content.field_name" adaptor="date_bootstrap" %} {% inplace_edit "content.field_name" adaptor="datetime_bootstrap" %}
Why this code is not in django-inplaceedit?
- This code depends on the bootstrap
- This is a specific solution
Testing
存在Requirements。此项目可用作演示项目。
此项目覆盖django-inplaceedit的默认选项和django inplaceedit bootstrap的默认选项
INPLACEEDIT_AUTO_SAVE = True INPLACEEDIT_EVENT = 'click' INPLACEEDIT_EDIT_TOOLTIP_TEXT = 'Click to edit' # This option is of django-inplaceedit-bootstrap
Development
通过克隆,您可以获得django inplaceedit引导程序的最新版本 它的git存储库:
git clone git@github.com:django-inplaceedit/django-inplaceedit-bootstrap.git
Releases
0.2.0 (2015-08-30)
- 在鼠标悬停时添加工具提示
- 将窗体类添加到字段中
- 测试项目的改进
- 支持django 1.7和django 1.8
- 支持最新版本的django-bootstrap3-datetimepicker
- 升级引导版本
0.1.1 (2013-09-17)
- 测试项目的改进
0.1.0 (2013-09-17)
- 自述文件的改进
0.0.3 (2013-09-16)
- Add the AdaptorDateBootStrapField and AdaptorDateTimeBootStrapField
- Customize the inplaceedit toolbar
- Customize the file adaptor
- Improvements in the fixtures of the testing project
0.0.2 (2013-09-10)
- Set the variable INPLACEEDIT_EVENT in the settings to “click”
- Fix typo errors in the README
0.0.1 (2013-09-06)
- Initial version