Something
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*swp
|
||||
*.pyc
|
||||
db*
|
||||
Binary file not shown.
Binary file not shown.
BIN
asuzr/admin.pyc
BIN
asuzr/admin.pyc
Binary file not shown.
@@ -3,6 +3,7 @@
|
||||
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
from datetime import date, timedelta
|
||||
|
||||
# Create your models here.
|
||||
#Соответствие названий и номеров дней недели
|
||||
@@ -87,6 +88,13 @@ class Order(models.Model):
|
||||
def ostatok(self):
|
||||
return self.price-self.paid
|
||||
|
||||
@property
|
||||
def calls_color(self):
|
||||
need_color=False
|
||||
if self.approved!=None:
|
||||
need_color = (date.today()-self.approved.date()>= timedelta(days = 10))
|
||||
return need_color
|
||||
|
||||
#Эскизы
|
||||
class Sketch(models.Model):
|
||||
sketch_file = models.FileField(upload_to = 'sketches') #путь к файу
|
||||
|
||||
BIN
asuzr/models.pyc
BIN
asuzr/models.pyc
Binary file not shown.
@@ -69,11 +69,17 @@ def main(request, day, month, year):
|
||||
})
|
||||
return HttpResponse(t.render(c))
|
||||
|
||||
def orders (request):
|
||||
order_list = Order.objects.filter(is_done=False).order_by('-id')
|
||||
def orders (request, archive):
|
||||
if archive=='0':
|
||||
is_done_value=False
|
||||
else:
|
||||
is_done_value=True
|
||||
|
||||
order_list = Order.objects.filter(is_done=is_done_value).order_by('-id')
|
||||
t=loader.get_template('asuzr/orders.html')
|
||||
c=Context({
|
||||
'order_list': order_list,
|
||||
'archive': is_done_value,
|
||||
})
|
||||
return HttpResponse(t.render(c))
|
||||
|
||||
|
||||
BIN
asuzr/views.pyc
BIN
asuzr/views.pyc
Binary file not shown.
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -10,6 +10,6 @@ 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'^orders/$', 'asuzr.views.orders'),
|
||||
url(r'^orders/(?P<archive>\d+)/$', 'asuzr.views.orders'),
|
||||
url(r'^admin/', include(admin.site.urls)),
|
||||
)
|
||||
|
||||
BIN
record/urls.pyc
BIN
record/urls.pyc
Binary file not shown.
BIN
record/wsgi.pyc
BIN
record/wsgi.pyc
Binary file not shown.
@@ -5,7 +5,7 @@
|
||||
<style></style>
|
||||
</head>
|
||||
<body>
|
||||
<H1>Таблица выхода заказов</H1>
|
||||
<H1>{% if archive %} Архивная таблица заказов {% else %} Таблица выхода заказов {% endif %}</H1>
|
||||
<TABLE BORDER WIDTH="100%">
|
||||
{% if order_list %}
|
||||
<ul>
|
||||
@@ -23,8 +23,10 @@
|
||||
<TH>Эскиз</TH>
|
||||
<TH>Исполнитель</TH>
|
||||
<TH>Сдан</TH>
|
||||
{% if archive %} <TH>Обзвон</TH> {% endif %}
|
||||
</TR>
|
||||
{% for order in order_list %}
|
||||
|
||||
<TR>
|
||||
<TD>{{ order.date_dmy }}</TD>
|
||||
<TD>{{ order.deadline_dmy }}</TD>
|
||||
@@ -39,6 +41,7 @@
|
||||
<TD>{{order.sketch.sketch_file}}</TD>
|
||||
<TD>{{ order.executor.first_name }}</TD>
|
||||
<TD>{%if order.is_done%} Да {%else%} Нет {% endif %}</TD>
|
||||
{% if archive %} <TD {% if order.calls_color%} bgcolor='FFFACD' {% endif %}>{{ order.calls}}</TD> {% endif %}
|
||||
</TR>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user