Sfoglia il codice sorgente

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

Добавил подсветку ячейки обзвон при отсутсвии в ней данных
и условии что прошло 10 дней со времени согласования
Denis V. Dedkov 10 anni fa
parent
commit
5777104eb7
2 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 2 0
      asuzr/models.py
  2. 2 1
      asuzr/tables.py

+ 2 - 0
asuzr/models.py

@@ -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
   
 #Эскизы

+ 2 - 1
asuzr/tables.py

@@ -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 = {}