示例#1
0
 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
示例#2
0
文件: models.py 项目: IVASPE/Synergy
 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)
示例#3
0
文件: models.py 项目: myszmen/Synergy
    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)
示例#4
0
文件: models.py 项目: IVASPE/Synergy
 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
示例#5
0
文件: models.py 项目: myszmen/Synergy
 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
示例#6
0
文件: models.py 项目: IVASPE/Synergy
 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