Подсветка ячейки Обзвон

Добавил подсветку ячейки обзвон при отсутсвии в ней данных
и условии что прошло 10 дней со времени согласования
This commit is contained in:
2015-06-19 19:58:23 +05:00
parent 66abc18dbf
commit 5777104eb7
2 changed files with 4 additions and 1 deletions

View File

@@ -101,6 +101,8 @@ class Order(models.Model):
need_color=False
if self.approved!=None:
need_color = (date.today()-self.approved.date()>= timedelta(days = 10))
need_color = need_color and (self.calls == '')
return need_color
#Эскизы

View File

@@ -35,8 +35,9 @@ class ColoredEditableColumn(EditableColumn):
self.condition_field = condition_field
def render(self, record, **kwargs):
print eval('record.%s' % self.condition_field)
if self.condition_field != None and eval('record.%s' % self.condition_field):
self.attrs = {'th': {'bgcolor': '#FFE4E1'}}
self.attrs = {'td': {'bgcolor': '#FFE4E1'}}
else:
self.attrs = {}