Для шаблона main параметры сделаны необязательными
This commit is contained in:
@@ -89,6 +89,9 @@ class DesignerTable(tables.Table):
|
||||
|
||||
def render_sum_price(self, value):
|
||||
return '%0.1f' % value
|
||||
|
||||
class Meta:
|
||||
attrs = {'class': 'paleblue'}
|
||||
|
||||
class SketchesTable(tables.Table):
|
||||
sketch_file = tables.FileColumn(verbose_name = 'Имя файла')
|
||||
|
||||
@@ -44,6 +44,13 @@ def get_orders_by_date(dt):
|
||||
|
||||
@login_required
|
||||
def main(request, day, month, year):
|
||||
if day == None:
|
||||
day = str(date.today().day)
|
||||
if month == None:
|
||||
month = str(date.today().month)
|
||||
if year == None:
|
||||
year = str(date.today().year)
|
||||
|
||||
d,m,y=int(day),int(month), int(year)
|
||||
|
||||
attend_list = Attendance.objects.all().order_by('date')
|
||||
@@ -129,7 +136,7 @@ def desreport(request):
|
||||
edate = datetime.strptime(end_date, '%d.%m.%y')
|
||||
Table = DesignerTable
|
||||
table = Table(Order.objects.filter(cancelled=False, date__range=(sdate,edate)).values('designer__first_name','designer__last_name').annotate(Sum('price'),Count('designer')))
|
||||
title = 'Отчет по дизайнерам за '+' - '.join((start_date, end_date))
|
||||
title = u'Отчет по дизайнерам за '+' - '.join((start_date, end_date))
|
||||
RequestConfig(request).configure(table)
|
||||
return render(request, 'asuzr/table.html', {'table': table, 'title': title})
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ ROOT_URLCONF = 'record.urls'
|
||||
|
||||
WSGI_APPLICATION = 'record.wsgi.application'
|
||||
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ js_info_dict = {
|
||||
urlpatterns = patterns('',
|
||||
url(r'^product/$', 'asuzr.views.prod_list'),
|
||||
url(r'^product/(?P<prod_id>\d+)/$', 'asuzr.views.prod_detail'),
|
||||
url(r'^main/(?P<day>\d+)/(?P<month>\d+)/(?P<year>\d+)/$', 'asuzr.views.main', name='asuzr-main'),
|
||||
url(r'^main/?(?P<day>\d+)?/?(?P<month>\d+)?/?(?P<year>\d+)?/$', 'asuzr.views.main', name='asuzr-main'),
|
||||
url(r'^orders/(?P<archive>\d+)/$', 'asuzr.views.orders',name='asuzr-orders'),
|
||||
url(r'^desreport/$', 'asuzr.views.desreport'),
|
||||
url(r'^production_table/(?P<order_id>\d+)/$', 'asuzr.views.production_table'),
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
{% block page %}
|
||||
<table WIDTH="100%">
|
||||
<TR VALIGN=top>
|
||||
<TD WIDTH="50%">{% include 'asuzr/attendance.html' %}</TD>
|
||||
<TD WIDTH="5%"></TD>
|
||||
<TD WIDTH="51%">{% include 'asuzr/attendance.html' %}</TD>
|
||||
<TD WIDTH="3%"></TD>
|
||||
<TD WIDTH="45%">{% include 'asuzr/orders_detail.html' %}</TD>
|
||||
</TR>
|
||||
</table>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<TD>{{ attend.date.weekday_name}}</TD>
|
||||
<TD>{% if attend.attend %}{% inplace_edit "attend.attend.calls" %}{% endif %}</TD>
|
||||
<TD>{% if attend.attend %}{% inplace_edit "attend.attend.visits" %}{% endif %}</TD>
|
||||
<TD><a href="{% url 'asuzr-main' attend.date.day attend.date.month attend.date.year %}">{{ attend.orders_count}}</a></TD>
|
||||
<TD><a href="{% url 'asuzr-main' %}{{attend.date.day}}/{{attend.date.month}}/{{attend.date.year}}">{{ attend.orders_count}}</a></TD>
|
||||
<TD>{{ attend.orders_price}}</TD>
|
||||
<TD>{{ attend.designers}}</TD>
|
||||
</TR>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<body>
|
||||
{% block menu %}
|
||||
<ul id="menu" class="hr">
|
||||
<li><a href={% url 'asuzr-main' 1 5 2015 %}>Таблица посещаемости</a></li>
|
||||
<li><a href={% url 'asuzr-main' %}>Таблица посещаемости</a></li>
|
||||
<li><a href={% url 'asuzr.views.orders' 0 %}>Таблица выхода заказов</a></li>
|
||||
<li><a href={% url 'asuzr.views.orders' 1 %}>Архивная таблица</a></li>
|
||||
<li><a href={% url 'asuzr.views.desreport' %}>Отчет по дизайнерам</a></li>
|
||||
|
||||
Reference in New Issue
Block a user