.. _usage: ===== Usage ===== Calling `inplace_edit tag `_ you can inplace edit any data from the database. It is important to clarify that the inline edition is not only for text fields, although it may be the more common usage. You can also have inline edition for choices, boolean fields, date and datetime fields, foreing keys, many to many, file and image fields. :: {% inplace_edit "OBJ.FIELD_NAME" %} {% inplace_edit "OBJ.FIELD_NAME|FILTER1|FILTER2|...|FILTERN" %} Simple example ============== :: {% load inplace_edit %} ... {% inplace_toolbar %} {% comment %} or inplace_static {% endcomment %} ...
... {% inplace_edit "content.name" %} ...
{% inplace_edit "content.date_initial|date:'d m Y'" %} {% inplace_edit "content.description|safe" %}
{% inplace_edit "content.body|safe|truncatewords_html:15" %}
... Example with the js in the footer ================================= :: {% load inplace_edit %} ... {% inplace_css 1 %} {% comment %} or inplace_css 0 {% endcomment %} ...
... {% inplace_edit "content.name" %} ...
{% inplace_edit "content.date_initial|date:'d m Y'" %} {% inplace_edit "content.description|safe" %}
{% inplace_edit "content.body|safe|truncatewords_html:15" %}
... {% inplace_js 1 1 %} {% comment %} or inplace_js 1 0 {% endcomment %} How to use it ------------- * If you use `inplace_static `_: Just pass the cursor above the field and double click (this is :ref:`customizable `), authenticated with a super user (this is also :ref:`customizable `) * If you use `inplace_toolbar `_: Enable a edit inline and just pass the cursor above the field and double click (this is :ref:`customizable `), authenticated with a super user (this is also :ref:`customizable `)