django inplaceedit与bootstrap的集成

django-inplaceedit-bootstrap的Python项目详细描述


django-inplaceedit-bootstrap

Information

https://badge.fury.io/py/django-inplaceedit-bootstrap.png

django-inplaceeditbootstrap 3的集成

它是根据GNU Lesser General Public License的条件分布的。

如果没有Tyrdall的帮助,这个蛋是不可能的

Requirements

Demo (this video use a very old version of django-inplaceedit and django-inplaceedit-extra-fields)

视频演示,共django-inplaceeditdjango-inplaceedit-extra-fieldsdjango-inlinetrans(设置全屏模式以正确查看)

https://github.com/django-inplaceedit/django-inplaceedit/raw/master/video-frame.png

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.1 (2015-08-30)

  • 详细信息

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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
当您有许多具有不同密钥值的位置时,java Enterprise是加密环境变量的正确方法   java如何使用视图保持器模式制作自定义适配器?   java如何迭代Camel体中的嵌套列表?   序列化用base 64进行Java序列化   java打开文件的最佳方式(并确保选择了文件)   java marvin图像色差插件错误   java如何在eclipse中添加属性文件文件夹   比较java。util。日历日期到java。util。日期   java无法在下一个类(活动)中获取哈希表   java如何将这段代码转换为循环?   java查找通过REST失败   java getIntent返回null   在Java中,如何通过外部集合从内部集合检索数据?   java单点登录以保护REST API和内部基于web的系统