def is_triggered(self, **kwargs): triggers = self.triggers.all() if triggers.exists(): return all((trigger.negate_trigger ^ bool( resolve_lookup(kwargs.get(trigger.argument.name), trigger.trigger_lookup)) for trigger in triggers)) return True
def is_triggered(self, obj): """ Obj is the objects that is the source of the field in column """ if not hasattr(self, '_is_triggered'): self._is_triggered = {} if not self._is_triggered.has_key(obj): self._is_triggered[obj] = True if self.trigger_lookup and not (obj is None): self._is_triggered[obj] = self.negate_trigger ^ bool(resolve_lookup(obj, self.trigger_lookup)) return self._is_triggered.get(obj, None)
def is_triggered(self, obj): """ Obj is the objects that is the source of the field in column """ if not hasattr(self, '_is_triggered'): self._is_triggered = {} if not self._is_triggered.has_key(obj): self._is_triggered[obj] = True if self.trigger_lookup and not (obj is None): self._is_triggered[obj] = self.negate_trigger ^ bool( resolve_lookup(obj, self.trigger_lookup)) return self._is_triggered.get(obj, None)
def is_triggered(self, **kwargs): triggers = self.triggers.all() if triggers.exists(): return all((trigger.negate_trigger ^ bool(resolve_lookup(kwargs.get(trigger.argument.name), trigger.trigger_lookup)) for trigger in triggers)) return True
def is_triggered(self, obj): """ Obj is the objects that is the source of the field in column """ if self.trigger_lookup and not (obj is None): return bool(resolve_lookup(obj, self.trigger_lookup)) return True