From 36d5b3262880bcd000eae594ba627a5be08306e5 Mon Sep 17 00:00:00 2001 From: Anastasia Date: Thu, 11 Jun 2015 11:07:42 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BB=D1=8F=20=D1=88=D0=B0=D0=B1=D0=BB?= =?UTF-8?q?=D0=BE=D0=BD=D0=B0=20main=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D1=80=D1=8B=20=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=BD=D0=B5=D0=BE=D0=B1=D1=8F=D0=B7=D0=B0=D1=82=D0=B5?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D1=8B=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asuzr/tables.py | 3 +++ asuzr/views.py | 9 ++++++++- record/settings.py | 1 - record/urls.py | 2 +- templates/asuzr/attend_order.html | 4 ++-- templates/asuzr/attendance.html | 2 +- templates/asuzr/base.html | 2 +- 7 files changed, 16 insertions(+), 7 deletions(-) diff --git a/asuzr/tables.py b/asuzr/tables.py index bc4ed69..995687e 100644 --- a/asuzr/tables.py +++ b/asuzr/tables.py @@ -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 = 'Имя файла') diff --git a/asuzr/views.py b/asuzr/views.py index 27b1647..6d35b40 100644 --- a/asuzr/views.py +++ b/asuzr/views.py @@ -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}) diff --git a/record/settings.py b/record/settings.py index dacb4ba..f44e9bc 100644 --- a/record/settings.py +++ b/record/settings.py @@ -56,7 +56,6 @@ ROOT_URLCONF = 'record.urls' WSGI_APPLICATION = 'record.wsgi.application' - # Database # https://docs.djangoproject.com/en/1.6/ref/settings/#databases diff --git a/record/urls.py b/record/urls.py index fabedd0..24d1c3a 100644 --- a/record/urls.py +++ b/record/urls.py @@ -14,7 +14,7 @@ js_info_dict = { urlpatterns = patterns('', url(r'^product/$', 'asuzr.views.prod_list'), url(r'^product/(?P\d+)/$', 'asuzr.views.prod_detail'), - url(r'^main/(?P\d+)/(?P\d+)/(?P\d+)/$', 'asuzr.views.main', name='asuzr-main'), + url(r'^main/?(?P\d+)?/?(?P\d+)?/?(?P\d+)?/$', 'asuzr.views.main', name='asuzr-main'), url(r'^orders/(?P\d+)/$', 'asuzr.views.orders',name='asuzr-orders'), url(r'^desreport/$', 'asuzr.views.desreport'), url(r'^production_table/(?P\d+)/$', 'asuzr.views.production_table'), diff --git a/templates/asuzr/attend_order.html b/templates/asuzr/attend_order.html index 2490922..acbf097 100644 --- a/templates/asuzr/attend_order.html +++ b/templates/asuzr/attend_order.html @@ -4,8 +4,8 @@ {% block page %} - - + +
{% include 'asuzr/attendance.html' %}{% include 'asuzr/attendance.html' %} {% include 'asuzr/orders_detail.html' %}
diff --git a/templates/asuzr/attendance.html b/templates/asuzr/attendance.html index 842ea68..be933b4 100644 --- a/templates/asuzr/attendance.html +++ b/templates/asuzr/attendance.html @@ -17,7 +17,7 @@ {{ attend.date.weekday_name}} {% if attend.attend %}{% inplace_edit "attend.attend.calls" %}{% endif %} {% if attend.attend %}{% inplace_edit "attend.attend.visits" %}{% endif %} - {{ attend.orders_count}} + {{ attend.orders_count}} {{ attend.orders_price}} {{ attend.designers}} diff --git a/templates/asuzr/base.html b/templates/asuzr/base.html index 5911fbd..cd2ceaf 100644 --- a/templates/asuzr/base.html +++ b/templates/asuzr/base.html @@ -30,7 +30,7 @@ {% block menu %}