Пример #1
0
 def get_handlers(self, handler_cls, workflow_object, *args, **kwargs):
     handlers = []
     for c in powerset(kwargs.keys()):
         skwargs = {}
         for f in c:
             skwargs[f] = kwargs.get(f)
         hash = self.get_handler_class(handler_cls).get_hash(workflow_object, **skwargs)
         handler = self.handlers.get(self.get_handler_class_prefix(self.get_handler_class(handler_cls)) + hash)
         if handler:
             handlers.append(handler)
     return handlers
Пример #2
0
 def get_handlers(self, handler_cls, workflow_object, field, *args, **kwargs):
     handlers = super(DatabaseHandlerBackend, self).get_handlers(handler_cls, workflow_object, field, *args, **kwargs)
     if not handlers:
         hashes = []
         for c in powerset(kwargs.keys()):
             skwargs = {}
             for f in c:
                 skwargs[f] = kwargs.get(f)
             hash = self.get_handler_class(handler_cls).get_hash(workflow_object, field, **skwargs)
             hashes.append(self.get_handler_class_prefix(self.get_handler_class(handler_cls)) + hash)
         handlers = self.__register(Handler.objects.filter(hash__in=hashes))
     return handlers
Пример #3
0
 def get_handlers(self, handler_cls, workflow_object, *args, **kwargs):
     handlers = []
     for c in powerset(kwargs.keys()):
         skwargs = {}
         for f in c:
             skwargs[f] = kwargs.get(f)
         hash = self.get_handler_class(handler_cls).get_hash(
             workflow_object, **skwargs)
         handler = self.handlers.get(
             self.get_handler_class_prefix(
                 self.get_handler_class(handler_cls)) + hash)
         if handler:
             handlers.append(handler)
     return handlers
Пример #4
0
 def get_handlers(self, handler_cls, workflow_object, *args, **kwargs):
     handlers = super(DatabaseHandlerBackend,
                      self).get_handlers(handler_cls, workflow_object,
                                         *args, **kwargs)
     if not handlers:
         hashes = []
         for c in powerset(kwargs.keys()):
             skwargs = {}
             for f in c:
                 skwargs[f] = kwargs.get(f)
             hash = self.get_handler_class(handler_cls).get_hash(
                 workflow_object, **skwargs)
             hashes.append(
                 self.get_handler_class_prefix(
                     self.get_handler_class(handler_cls)) + hash)
         handlers = self.__register(Handler.objects.filter(hash__in=hashes))
     return handlers