From bef243a2bf392350da20276c5b2d6348a74236c8 Mon Sep 17 00:00:00 2001 From: "Denis V. Dedkov" Date: Tue, 16 Jun 2015 20:29:07 +0500 Subject: [PATCH 1/9] =?UTF-8?q?=D0=A8=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D1=82=D1=80=D0=B5=D1=85=20=D1=82=D0=B0?= =?UTF-8?q?=D0=B1=D0=BB=D0=B8=D1=86=20=D0=BD=D0=B0=20=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=86=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Сделал шаблон для трех таблиц на странице --- asuzr/views.py | 34 ++++++++++++++++++------------ templates/asuzr/base.html | 3 +++ templates/asuzr/table3.html | 10 +++++++++ templates/asuzr/weekend_table.html | 3 +++ 4 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 templates/asuzr/table3.html diff --git a/asuzr/views.py b/asuzr/views.py index 162497f..5405122 100644 --- a/asuzr/views.py +++ b/asuzr/views.py @@ -42,15 +42,13 @@ def get_orders_by_date(dt): order_list = Order.objects.filter(date=dt).order_by('id') return order_list -@login_required -def visit_view(request): - curr_date = datetime.strptime(request.GET.get('date', date.today().strftime('%d.%m.%Y')), '%d.%m.%Y') - y,m = curr_date.year, curr_date.month - day_in_month = calendar.monthrange(y,m)[1] - month_days = {i+1: {'date': custom_date(y,m,i+1)} for i in range(day_in_month)} - sdate = date(y,m,1) - edate = date(y,m,day_in_month) +def get_attendance_table(year, month, prefix): + day_in_month = calendar.monthrange(year,month)[1] + sdate = date(year,month,1) + edate = date(year,month,day_in_month) + month_days = {i+1: {'date': custom_date(year,month,i+1)} for i in range(day_in_month)} + attend_list = Attendance.objects.filter(date__range = (sdate,edate)) attend_sum = attend_list.aggregate(Sum('calls'), Sum('visits')) for attend in attend_list: @@ -61,8 +59,6 @@ def visit_view(request): order_list = order_list.values('date') order_list = order_list.annotate(Count('product'), Sum('price')) - print order_sum - for order in order_list: month_days[order['date'].day]['order'] = order @@ -75,16 +71,28 @@ def visit_view(request): else: month_days[day]['designer'] = designer - table = VisitTable(month_days.values()) - RequestConfig(request, paginate={'per_page': 32}).configure(table) + table = VisitTable(month_days.values(), prefix = prefix) + table.verbose_name = 'Сводная информация' table.set_summaries({ 'calls': attend_sum['calls__sum'], 'visits': attend_sum['visits__sum'], 'orders': order_sum['product__count'], 'cost': order_sum['price__sum'], }) + + return table + +@login_required +def visit_view(request): + curr_date = datetime.strptime(request.GET.get('date', date.today().strftime('%d.%m.%Y')), '%d.%m.%Y') + attendance_table = get_attendance_table(curr_date.year, curr_date.month, 'attendance-') + RequestConfig(request, paginate={'per_page': 32}).configure(attendance_table) title = 'Таблица посещаемости на %s г.' % curr_date.strftime('%B %Y') - return render(request, 'asuzr/table.html', {'table': table, 'title': title}) + return render(request, 'asuzr/table3.html', { + 'table1': attendance_table, + 'table2': attendance_table, + 'table3': attendance_table, + 'title': title}) @login_required def main(request, day, month, year): diff --git a/templates/asuzr/base.html b/templates/asuzr/base.html index 3652da5..69d7f6a 100644 --- a/templates/asuzr/base.html +++ b/templates/asuzr/base.html @@ -29,6 +29,9 @@ table.paleblue tr.weekend { background-color: #FFE4E1 } + .inline { + display: inline-block; + } diff --git a/templates/asuzr/table3.html b/templates/asuzr/table3.html new file mode 100644 index 0000000..afac64e --- /dev/null +++ b/templates/asuzr/table3.html @@ -0,0 +1,10 @@ +{% extends "asuzr/base.html" %} +{% load inplace_edit %} +{% load render_table from django_tables2 %} + +{% block page %} +

{{ table1.verbose_name }}

{% render_table table1 %}
+

{{ table2.verbose_name }}

{% render_table table2 %}
+

{{ table3.verbose_name }}

{% render_table table3 %}
+{% endblock %} + diff --git a/templates/asuzr/weekend_table.html b/templates/asuzr/weekend_table.html index 0b167f9..88d2dab 100644 --- a/templates/asuzr/weekend_table.html +++ b/templates/asuzr/weekend_table.html @@ -56,5 +56,8 @@ {% endnospaceless %} {% endblock table %} +{% if table.page %} + +{% endif %} {% endspaceless %} From 20f6d8eab27703e264c763e029de51788219a630 Mon Sep 17 00:00:00 2001 From: "Denis V. Dedkov" Date: Tue, 16 Jun 2015 20:33:36 +0500 Subject: [PATCH 2/9] =?UTF-8?q?=D0=90=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82?= =?UTF-8?q?=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=B0=D1=8F=20=D1=88=D0=B8=D1=80?= =?UTF-8?q?=D0=B8=D0=BD=D0=B0=20=D1=8D=D0=B4=D0=B8=D1=82=D0=BE=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавил автоматическую установку ширины в inplace edit --- asuzr/tables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asuzr/tables.py b/asuzr/tables.py index 0c9ca23..e65d13b 100644 --- a/asuzr/tables.py +++ b/asuzr/tables.py @@ -17,12 +17,12 @@ class EditableColumn(tables.TemplateColumn): main_part = '' if object_name == '': main_part = ''' - {{% inplace_edit "record.{field}" auto_height = 1 %}} + {{% inplace_edit "record.{field}" auto_height = 1, auto_width = 1 %}} ''' else: main_part = ''' {{% if record.{object_name} %}} - {{% inplace_edit "record.{object_name}.{field}" auto_height = 1 %}} + {{% inplace_edit "record.{object_name}.{field}" auto_height = 1, auto_width = 1 %}} {{% endif %}} ''' template = template.format(main_part = main_part) From 6f054bef1ffccddb971297b58e0e3ca5fe47866a Mon Sep 17 00:00:00 2001 From: "Denis V. Dedkov" Date: Tue, 16 Jun 2015 23:08:22 +0500 Subject: [PATCH 3/9] =?UTF-8?q?=D0=A2=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=D0=B0?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=BA=D0=B0=D0=B7=D0=BE=D0=B2=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=B4=D0=B5=D0=BD=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавил таблицу заказов на день --- asuzr/tables.py | 31 ++++++++++++++++++++++++------- asuzr/views.py | 7 ++++++- templates/asuzr/base.html | 1 + 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/asuzr/tables.py b/asuzr/tables.py index e65d13b..f14b83d 100644 --- a/asuzr/tables.py +++ b/asuzr/tables.py @@ -43,7 +43,7 @@ class ThumbnailColumn(tables.TemplateColumn): class OrdersTable(tables.Table): date = tables.DateColumn('d/m/Y', verbose_name = 'Дата') - deadline = tables.DateColumn('d/m/Y/', verbose_name = 'Срок сдачи') + deadline = tables.DateColumn('d/m/Y', verbose_name = 'Срок сдачи') product = tables.Column(verbose_name = 'Наименование') delivery = EditableColumn('delivery', verbose_name = 'Доставка') lifting = EditableColumn('lifting', verbose_name = 'Подъем') @@ -55,12 +55,7 @@ class OrdersTable(tables.Table): sketch = tables.LinkColumn('asuzr.views.sketches', verbose_name = 'Эскизы', args=[tables.utils.A('pk')]) executor = EditableColumn('executor', verbose_name = 'Исполнитель') is_done = EditableColumn('is_done', verbose_name = 'Сдан') - id = tables.Column(visible = False) - designer = tables.Column(visible = False) - calls = tables.Column(visible = False) - contact = tables.Column(visible = False) - phone_num = tables.Column(visible = False) - cancelled = tables.Column(visible = False) + designer = tables.Column(visible = False) # Почему-то дизайнер в exclude вызывает ошибку, м.б. из-за FK. Разобраться def render_price(self, value): return '%0.1f' % value @@ -84,6 +79,7 @@ class OrdersTable(tables.Table): 'sketch', 'executor', 'is_done',) + exclude = ('id', 'calls', 'contact', 'phone_num', 'cancelled',) class ArchiveOrdersTable(OrdersTable): calls = EditableColumn('calls', verbose_name = 'Обзвон') @@ -142,3 +138,24 @@ class VisitTable(tables.Table): attrs = {'class': 'paleblue'} orderable = False template = 'asuzr/weekend_table.html' + +class DayOrdersTable(OrdersTable): + designer = tables.Column(verbose_name = 'Дизайнер') + class Meta: + attrs = {'class': 'paleblue'} + exclude = ('date', + 'delivery', + 'lifting', + 'paid', + 'ostatok', + 'approved', + 'sketch', + 'executor', + 'is_done', + ) + sequence = ('product', + 'price', + 'address', + 'designer', + 'deadline', + ) diff --git a/asuzr/views.py b/asuzr/views.py index 5405122..07ad73b 100644 --- a/asuzr/views.py +++ b/asuzr/views.py @@ -87,10 +87,15 @@ def visit_view(request): curr_date = datetime.strptime(request.GET.get('date', date.today().strftime('%d.%m.%Y')), '%d.%m.%Y') attendance_table = get_attendance_table(curr_date.year, curr_date.month, 'attendance-') RequestConfig(request, paginate={'per_page': 32}).configure(attendance_table) + + orders_table = DayOrdersTable(Order.objects.filter(date = curr_date)) + orders_table.verbose_name = 'Заказы на %s г' % curr_date.strftime('%d %B %Y') + RequestConfig(request).configure(orders_table) + title = 'Таблица посещаемости на %s г.' % curr_date.strftime('%B %Y') return render(request, 'asuzr/table3.html', { 'table1': attendance_table, - 'table2': attendance_table, + 'table2': orders_table, 'table3': attendance_table, 'title': title}) diff --git a/templates/asuzr/base.html b/templates/asuzr/base.html index 69d7f6a..2914f10 100644 --- a/templates/asuzr/base.html +++ b/templates/asuzr/base.html @@ -31,6 +31,7 @@ } .inline { display: inline-block; + vertical-align: top; } From 8cea3edb6b72a6e4f35b77f32b7e7e7dd1821fc9 Mon Sep 17 00:00:00 2001 From: "Denis V. Dedkov" Date: Tue, 16 Jun 2015 23:33:47 +0500 Subject: [PATCH 4/9] =?UTF-8?q?=D0=A2=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=D0=B0?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=BA=D0=B0=D0=B7=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Доделал таблицу заказов --- asuzr/tables.py | 12 ++++-- asuzr/views.py | 14 ++++-- templates/asuzr/totals_table.html | 15 +++++++ templates/asuzr/weekend_table.html | 69 +++++------------------------- 4 files changed, 45 insertions(+), 65 deletions(-) create mode 100644 templates/asuzr/totals_table.html diff --git a/asuzr/tables.py b/asuzr/tables.py index f14b83d..74b464e 100644 --- a/asuzr/tables.py +++ b/asuzr/tables.py @@ -119,10 +119,9 @@ class VisitTable(tables.Table): designer = tables.Column(verbose_name = 'Дизайнеры') summary = ['Всего','',0,0,0,0,''] - def set_summaries(self, summaries): - indexes = {'calls': 2, 'visits': 3, 'orders': 4, 'cost': 5} - for s in summaries: + indexes = {'calls': 2, 'visits': 3, 'orders': 4, 'cost': 5} + for s in summaries: idx = indexes[s] self.summary[idx] = summaries[s] @@ -141,6 +140,12 @@ class VisitTable(tables.Table): class DayOrdersTable(OrdersTable): designer = tables.Column(verbose_name = 'Дизайнер') + + summary = ['Всего', 0, '', '', '',] + + def set_summary(self, price): + self.summary[1] = price + class Meta: attrs = {'class': 'paleblue'} exclude = ('date', @@ -159,3 +164,4 @@ class DayOrdersTable(OrdersTable): 'designer', 'deadline', ) + template = 'asuzr/totals_table.html' diff --git a/asuzr/views.py b/asuzr/views.py index 07ad73b..d381f39 100644 --- a/asuzr/views.py +++ b/asuzr/views.py @@ -82,17 +82,25 @@ def get_attendance_table(year, month, prefix): return table +def get_day_orders_table(date, prefix): + orders = Order.objects.filter(date = date) + orders_price = orders.aggregate(Sum('price')) + table = DayOrdersTable(orders, prefix = prefix) + table.verbose_name = 'Заказы на %s' % date.strftime('%d %B %Y г') + table.set_summary(orders_price['price__sum']) + + return table + @login_required def visit_view(request): curr_date = datetime.strptime(request.GET.get('date', date.today().strftime('%d.%m.%Y')), '%d.%m.%Y') attendance_table = get_attendance_table(curr_date.year, curr_date.month, 'attendance-') RequestConfig(request, paginate={'per_page': 32}).configure(attendance_table) - orders_table = DayOrdersTable(Order.objects.filter(date = curr_date)) - orders_table.verbose_name = 'Заказы на %s г' % curr_date.strftime('%d %B %Y') + orders_table = get_day_orders_table(curr_date, 'orders-') RequestConfig(request).configure(orders_table) - title = 'Таблица посещаемости на %s г.' % curr_date.strftime('%B %Y') + title = 'Таблица посещаемости на %s' % curr_date.strftime('%B %Y г') return render(request, 'asuzr/table3.html', { 'table1': attendance_table, 'table2': orders_table, diff --git a/templates/asuzr/totals_table.html b/templates/asuzr/totals_table.html new file mode 100644 index 0000000..d33a002 --- /dev/null +++ b/templates/asuzr/totals_table.html @@ -0,0 +1,15 @@ +{% extends "django_tables2/table.html" %} +{% load django_tables2 %} +{% load i18n %} +{% block table.tfoot %} + + {% if table.summary %} + + {% for summary in table.summary %} + {{ summary }} + {% endfor %} + + {% endif %} + +{% endblock table.tfoot %} + diff --git a/templates/asuzr/weekend_table.html b/templates/asuzr/weekend_table.html index 88d2dab..ddacc7d 100644 --- a/templates/asuzr/weekend_table.html +++ b/templates/asuzr/weekend_table.html @@ -1,63 +1,14 @@ -{% spaceless %} +{% extends "asuzr/totals_table.html" %} {% load django_tables2 %} {% load i18n %} -{% if table.page %} -
-{% endif %} -{% block table %} - - {% nospaceless %} - {% block table.thead %} - - - {% for column in table.columns %} - {% if column.orderable %} - {{ column.header }} - {% else %} - {{ column.header }} - {% endif %} - {% endfor %} - - - {% endblock table.thead %} - {% block table.tbody %} - - {% for row in table.page.object_list|default:table.rows %} {# support pagination #} - {% block table.tbody.row %} - {# avoid cycle for Django 1.2-1.6 compatibility #} - {% for column, cell in row.items %} - {% if column.localize == None %}{{ cell }}{% else %}{% if column.localize %}{{ cell|localize }}{% else %}{{ cell|unlocalize }}{% endif %}{% endif %} - {% endfor %} - - {% endblock table.tbody.row %} - {% empty %} - {% if table.empty_text %} - {% block table.tbody.empty_text %} - {{ table.empty_text }} - {% endblock table.tbody.empty_text %} - {% endif %} - {% endfor %} - - {% endblock table.tbody %} - {% block table.tfoot %} - - {% if table.summary %} - - {% for summary in table.summary %} - {{ summary }} +{% block table.tbody.row %} + {# avoid cycle for Django 1.2-1.6 compatibility #} + {% for column, cell in row.items %} + {% if column.localize == None %}{{ cell }}{% else %}{% if column.localize %}{{ cell|localize }}{% else %}{{ cell|unlocalize }}{% endif %}{% endif %} {% endfor %} - - {% endif %} - - {% endblock table.tfoot %} - {% endnospaceless %} - -{% endblock table %} -{% if table.page %} -
-{% endif %} + +{% endblock table.tbody.row %} -{% endspaceless %} From 3c757c30bfc9a55ae4f92bd9dee30e632026236c Mon Sep 17 00:00:00 2001 From: "Denis V. Dedkov" Date: Tue, 16 Jun 2015 23:41:53 +0500 Subject: [PATCH 5/9] =?UTF-8?q?=D0=A2=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=D0=B0?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=BA=D0=B0=D0=B7=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Сделал рендеринг имени дизайнера вместо логина --- asuzr/tables.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/asuzr/tables.py b/asuzr/tables.py index 74b464e..44c09db 100644 --- a/asuzr/tables.py +++ b/asuzr/tables.py @@ -58,10 +58,10 @@ class OrdersTable(tables.Table): designer = tables.Column(visible = False) # Почему-то дизайнер в exclude вызывает ошибку, м.б. из-за FK. Разобраться def render_price(self, value): - return '%0.1f' % value + return '%0.2f' % value def render_ostatok(self, value): - return '%0.1f' % value + return '%0.2f' % value class Meta: model = Order @@ -146,6 +146,9 @@ class DayOrdersTable(OrdersTable): def set_summary(self, price): self.summary[1] = price + def render_designer(self, value): + return ' '.join((value.first_name, value.last_name)) + class Meta: attrs = {'class': 'paleblue'} exclude = ('date', From ed6301e2a1cc3a95df1b2b979cfbd275261c2e72 Mon Sep 17 00:00:00 2001 From: "Denis V. Dedkov" Date: Wed, 17 Jun 2015 00:14:53 +0500 Subject: [PATCH 6/9] =?UTF-8?q?=D0=A1=D0=BF=D1=80=D0=B0=D0=B2=D0=BE=D1=87?= =?UTF-8?q?=D0=BD=D0=B0=D1=8F=20=D0=B8=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D1=8F=20=D0=B4=D0=BB=D1=8F=20=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=86=D1=8B=20=D0=BF=D0=BE=D1=81=D0=B5=D1=89?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавил блок справочной информации для таблицы посещений --- asuzr/views.py | 19 +++++++++++++++---- templates/asuzr/table2.html | 24 ++++++++++++++++++++++++ templates/asuzr/table3.html | 10 ---------- 3 files changed, 39 insertions(+), 14 deletions(-) create mode 100644 templates/asuzr/table2.html delete mode 100644 templates/asuzr/table3.html diff --git a/asuzr/views.py b/asuzr/views.py index d381f39..a3bb3d4 100644 --- a/asuzr/views.py +++ b/asuzr/views.py @@ -71,6 +71,17 @@ def get_attendance_table(year, month, prefix): else: month_days[day]['designer'] = designer + month_plan = OrderPlan.objects.filter(date = sdate).first() + month_plan = 0 if month_plan == None else month_plan.plan + month_balance = month_plan - order_sum['price__sum'] + + additional_info = {'title': 'Справочно', + 'rows': [ + {'title': 'ПЛАН', 'value': month_plan}, + {'title': 'Осталось до выполнения', 'value': month_balance}, + ] + } + table = VisitTable(month_days.values(), prefix = prefix) table.verbose_name = 'Сводная информация' table.set_summaries({ @@ -80,7 +91,7 @@ def get_attendance_table(year, month, prefix): 'cost': order_sum['price__sum'], }) - return table + return table, additional_info def get_day_orders_table(date, prefix): orders = Order.objects.filter(date = date) @@ -94,17 +105,17 @@ def get_day_orders_table(date, prefix): @login_required def visit_view(request): curr_date = datetime.strptime(request.GET.get('date', date.today().strftime('%d.%m.%Y')), '%d.%m.%Y') - attendance_table = get_attendance_table(curr_date.year, curr_date.month, 'attendance-') + attendance_table, add_info = get_attendance_table(curr_date.year, curr_date.month, 'attendance-') RequestConfig(request, paginate={'per_page': 32}).configure(attendance_table) orders_table = get_day_orders_table(curr_date, 'orders-') RequestConfig(request).configure(orders_table) title = 'Таблица посещаемости на %s' % curr_date.strftime('%B %Y г') - return render(request, 'asuzr/table3.html', { + return render(request, 'asuzr/table2.html', { 'table1': attendance_table, 'table2': orders_table, - 'table3': attendance_table, + 'additional_info': add_info, 'title': title}) @login_required diff --git a/templates/asuzr/table2.html b/templates/asuzr/table2.html new file mode 100644 index 0000000..d42a7f0 --- /dev/null +++ b/templates/asuzr/table2.html @@ -0,0 +1,24 @@ +{% extends "asuzr/base.html" %} +{% load inplace_edit %} +{% load render_table from django_tables2 %} + +{% block page %} +

{{ table1.verbose_name }}

{% render_table table1 %}
+

{{ table2.verbose_name }}

{% render_table table2 %}
+ {% if additional_info %} +
+
+
+

{{ additional_info.title }}

+
+
+ + {% for row in additional_info.rows %} + + {% endfor %} +
{{ row.title }}{{ row.value }}
+
+
+ {% endif %} +{% endblock %} + diff --git a/templates/asuzr/table3.html b/templates/asuzr/table3.html deleted file mode 100644 index afac64e..0000000 --- a/templates/asuzr/table3.html +++ /dev/null @@ -1,10 +0,0 @@ -{% extends "asuzr/base.html" %} -{% load inplace_edit %} -{% load render_table from django_tables2 %} - -{% block page %} -

{{ table1.verbose_name }}

{% render_table table1 %}
-

{{ table2.verbose_name }}

{% render_table table2 %}
-

{{ table3.verbose_name }}

{% render_table table3 %}
-{% endblock %} - From 2b7c157cf41a440fd785692294abf8e9e5997fb6 Mon Sep 17 00:00:00 2001 From: "Denis V. Dedkov" Date: Wed, 17 Jun 2015 00:21:41 +0500 Subject: [PATCH 7/9] =?UTF-8?q?=D0=9F=D0=BB=D0=B0=D0=B2=D0=B0=D1=8E=D1=89?= =?UTF-8?q?=D0=B0=D1=8F=20=D0=B1=D0=B0=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asuzr/tables.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/asuzr/tables.py b/asuzr/tables.py index 44c09db..ec1cf66 100644 --- a/asuzr/tables.py +++ b/asuzr/tables.py @@ -55,7 +55,6 @@ class OrdersTable(tables.Table): sketch = tables.LinkColumn('asuzr.views.sketches', verbose_name = 'Эскизы', args=[tables.utils.A('pk')]) executor = EditableColumn('executor', verbose_name = 'Исполнитель') is_done = EditableColumn('is_done', verbose_name = 'Сдан') - designer = tables.Column(visible = False) # Почему-то дизайнер в exclude вызывает ошибку, м.б. из-за FK. Разобраться def render_price(self, value): return '%0.2f' % value @@ -79,7 +78,7 @@ class OrdersTable(tables.Table): 'sketch', 'executor', 'is_done',) - exclude = ('id', 'calls', 'contact', 'phone_num', 'cancelled',) + exclude = ('id', 'calls', 'contact', 'phone_num', 'cancelled', 'designer', ) class ArchiveOrdersTable(OrdersTable): calls = EditableColumn('calls', verbose_name = 'Обзвон') From e2707b75d2f218c92becf2124af408056ee9dfd2 Mon Sep 17 00:00:00 2001 From: "Denis V. Dedkov" Date: Wed, 17 Jun 2015 00:32:11 +0500 Subject: [PATCH 8/9] =?UTF-8?q?=D0=A1=D1=81=D1=8B=D0=BB=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=82=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=D1=83=20?= =?UTF-8?q?=D0=BF=D0=BE=D1=81=D0=B5=D1=89=D0=B0=D0=B5=D0=BC=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Теперь ведет на новую страницу --- templates/asuzr/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/asuzr/base.html b/templates/asuzr/base.html index 2914f10..335e34b 100644 --- a/templates/asuzr/base.html +++ b/templates/asuzr/base.html @@ -39,7 +39,7 @@