diff --git a/asuzr/models.py b/asuzr/models.py index 8f571ea..885c3fc 100644 --- a/asuzr/models.py +++ b/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 #Эскизы diff --git a/asuzr/tables.py b/asuzr/tables.py index 60c94fb..e94b15f 100644 --- a/asuzr/tables.py +++ b/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 = {}