Skip to main content

Integration of django-inplaceedit and bootstrap

Project description

django-inplaceedit-bootstrap

Information

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

Integration of django-inplaceedit with bootstrap 3

It is distributed under the terms of the GNU Lesser General Public License.

This egg would not have been possible without the help of Tyrdall

Requirements

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

Video Demo, of django-inplaceedit, django-inplaceedit-extra-fields and django-inlinetrans (Set full screen mode to view it correctly)

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

Attention: This demo is not a demo of this package, in this video there are not any inegration with bootstrap. Please to see a demo use the testing django project.

Installation

After installing django-inplaceedit egg

After installing django-inplaceedit-extra-fields egg (this is optional but recommended)

And after installing django-bootstrap3-datetimepicker egg (this is optional but recommended)

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
)

...

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-hypernode.com/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'

If you want, you can register these fields in your settings with different keys:

::

if ‘bootstrap3_datetime’ in INSTALLED_APPS:

ADAPTOR_INPLACEEDIT[‘date_bootstrap’] = ‘inplaceeditform_bootstrap.fields.AdaptorDateBootStrapField’ ADAPTOR_INPLACEEDIT[‘datetime_bootstrap’] = ‘inplaceeditform_bootstrap.fields.AdaptorDateTimeBootStrapField’

And after that, to want use a specific adaptor you can pass it to the templatetag, e.g.:

{% 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

Exists a testing django project. This project can use as demo project.

This project overwrites the default options of django-inplace

INPLACEEDIT_AUTO_SAVE = True
INPLACEEDIT_EVENT = "click"

Development

You can get the bleeding edge version of django-inplaceedit-bootstrap by doing a clone of its git repository:

git clone git@github.com:goinnn/django-inplaceedit-bootstrap.git

Releases

0.1.1 (2013-09-17)

  • Improvements in the testing project

0.1.0 (2013-09-17)

  • Improvements in the README file

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-inplaceedit-bootstrap-0.1.1.tar.gz (10.7 kB view details)

Uploaded Source

File details

Details for the file django-inplaceedit-bootstrap-0.1.1.tar.gz.

File metadata

File hashes

Hashes for django-inplaceedit-bootstrap-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5ef0e5e8d6135f140b2acf405228b7cb96d3b8fef6636adef586fab24ba6cce9
MD5 9e2f3e2036a9a2029ba96d2204b5c6c4
BLAKE2b-256 4c3c4d3cde28bab581550721c8e15e41552eaa95e1dab0cf911aa5a8de41d90e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page