Skip to content

django-inplaceedit/django-inplaceedit-extra-fields

Repository files navigation

django-inplaceedit-extra-fields

Information

image

django-inplaceedit-extra-fields is a Django application that adds other useful fields to django-inplaceedit .

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

Requirements

And other packages, depending on which fields you want to use (see below).

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)

image

Installation

After installing django-inplaceedit egg

In your settings.py

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',
    #.....................#
    'inplaceeditform',
    'inplaceeditform_extra_fields',
)

If you want to overwrite the adaptors for all cases in your project:

ADAPTOR_INPLACEEDIT = {'textarea': 'inplaceeditform_extra_fields.fields.AdaptorTinyMCEField',
                       #'textarea': 'inplaceeditform_extra_fields.fields.AdaptorSimpleTinyMCEField',
                       'image': 'inplaceeditform_extra_fields.fields.AdaptorImageThumbnailField',
                       'fk': 'inplaceeditform_extra_fields.fields.AdaptorAutoCompleteForeingKeyField',
                       'm2mcomma': 'inplaceeditform_extra_fields.fields.AdaptorAutoCompleteManyToManyField'}

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

ADAPTOR_INPLACEEDIT = {'auto_fk': 'inplaceeditform_extra_fields.fields.AdaptorAutoCompleteForeingKeyField',
                       'auto_m2m': 'inplaceeditform_extra_fields.fields.AdaptorAutoCompleteManyToManyField',
                       'image_thumb': 'inplaceeditform_extra_fields.fields.AdaptorImageThumbnailField',
                       'tiny': 'inplaceeditform_extra_fields.fields.AdaptorTinyMCEField',
                       'tiny_simple': 'inplaceeditform_extra_fields.fields.AdaptorSimpleTinyMCEField'}

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

{% inplace_edit "content.field_name" adaptor="tiny" %}

Why these fields are not in django-inplaceedit?

  • They depend on the other eggs
  • They are a specific solution
  • These do not work immediately, you have to code them

AdaptorAutoCompleteForeingKeyField and AdaptorAutoCompleteManyToManyField

These fields depend on django-ajax-selects (1.3.6). You have to create a channel (lookup)

{% inplace_edit "content.field_name" adaptor="auto_fk", lookup="my_lookup" %}

For more info, visit the doc of django-ajax-selects

It is recomended you overwrite the following templates:

AdaptorImageThumbnailField

This field depends on sorl-thumbnail (12.3). You just need to specify the thumb size.

{% inplace_edit "content.field_name" adaptor="image_thumb", size="16x16" %}

It can help you, configure in your settings:

THUMBNAIL_DEBUG = True

For more info, visit the doc of sorl-thumbnail

AdaptorTinyMCEField and AdaptorSimpleTinyMCEField

{% inplace_edit "content.field_name" adaptor="tiny" %}
or 
{% inplace_edit "content.field_name" adaptor="tiny_simple" %}

Note

We use tinyMCE 4.0 without changes (from django-inplaceedit-extra-fields==0.3.0), if you want to use another version (4.X) of tinyMCE set INPLACE_TINYMCE_JS in your settings.

INPLACE_TINYMCE_JS = '/my/path/of/tinyMCE'

If you want to use a tinyMCE 3.X, please use django-inplaceedit-extra-fields==0.2.4

Testing

You can test it with the testing project of django-inplaceedit or with the testing project of django-inplaceedit-bootstrap

Development

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

git clone git@github.com:django-inplaceedit/django-inplaceedit-extra-fields.git