Exemplo n.º 1
0
    def __call__(self):
        expected = self.element.skos
        obj = aq_inner(self.event.object)

        if not (utils.vcge_available(obj)):
            return False

        skos = utils.vcge_for_object(obj)
        if not expected:
            return not (expected or skos)
        intersection = set(expected).intersection(skos)
        return intersection and True or False
Exemplo n.º 2
0
    def __call__(self):
        expected = self.element.skos
        obj = aq_inner(self.event.object)

        if not (utils.vcge_available(obj)):
            return False

        skos = utils.vcge_for_object(obj)
        if not expected:
            return not (expected or skos)
        intersection = set(expected).intersection(skos)
        return intersection and True or False
Exemplo n.º 3
0
 def __call__(self):
     """Apply selected layout to a content item."""
     obj = self.event.object
     same_as_parent = self.element.same_as_parent
     skos = self.element.skos
     if not (utils.vcge_available(obj)):
         return False
     if same_as_parent:
         parent = aq_parent(obj)
         if not (utils.vcge_available(parent)):
             return False
         skos = utils.vcge_for_object(parent)
     return utils.set_vcge(obj, skos)
Exemplo n.º 4
0
 def __call__(self):
     """  Apply selected layout to a content item
     """
     obj = self.event.object
     same_as_parent = self.element.same_as_parent
     skos = self.element.skos
     if not (utils.vcge_available(obj)):
         return False
     if same_as_parent:
         parent = aq_parent(obj)
         if not (utils.vcge_available(parent)):
             return False
         skos = utils.vcge_for_object(parent)
     return utils.set_vcge(obj, skos)