Добавлено редактирование полей модели.

Для корректного использования необходимо установить пакет django-inplaceedit:

sudo pip install django-inplaceedit

После установки пакета его необходимо доавить в INSTALLED_APPS в settings.py:

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'inplaceeditform',
    'asuzr',
)
This commit is contained in:
2015-05-31 17:28:52 +05:00
parent ad76fd423b
commit 382ec6fa21
5 changed files with 13 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
{% extends "asuzr/base.html" %}
{% load inplace_edit %}
{% block title %}{% if archive %} Архивная таблица заказов {% else %} Таблица выхода заказов {% endif %}{% endblock %}
@@ -27,10 +28,10 @@
<TR>
<TD>{{ order.date_dmy }}</TD>
<TD>{{ order.deadline_dmy }}</TD>
<TD>{{ order.product.name }}</TD>
<TD>{% inplace_edit "order.product.name" %}</TD>
<TD>{%if order.delivery%} Да {% else %} Нет {% endif %} </TD>
<TD>{%if order.lifting%} Да {% else %} Нет {% endif %}</TD>
<TD>{{ order.address }}</TD>
<TD>{% inplace_edit "order.address" %}</TD>
<TD>{{ order.price }}</TD>
<TD>{{ order.paid }}</TD>
<TD>{{ order.ostatok }}</TD>