コード例 #1
0
ファイル: base.py プロジェクト: Python3pkg/Products.Silva
    def validate(self, target, adding=False):
        if target is None:
            return errors.EmptyInvalidTarget()
        if IGhostAware.providedBy(target):
            return errors.GhostInvalidTarget()
        # Check for cicular reference. You cannot select an ancestor
        # or descandant of the ghost (or the ghost)
        target_path = target.getPhysicalPath()
        if adding:
            test_path = self.container.getPhysicalPath()
        else:
            test_path = self.ghost.getPhysicalPath()

        # XXX !!!!
        if not adding and len(target_path) > len(test_path):
            if test_path == target_path[:len(test_path)]:
                return errors.CircularInvalidTarget()
        elif target_path == test_path[:len(target_path)]:
            return errors.CircularInvalidTarget()
コード例 #2
0
ファイル: base.py プロジェクト: silvacms/Products.Silva
    def validate(self, target, adding=False):
        if target is None:
            return errors.EmptyInvalidTarget()
        if IGhostAware.providedBy(target):
            return errors.GhostInvalidTarget()
        # Check for cicular reference. You cannot select an ancestor
        # or descandant of the ghost (or the ghost)
        target_path = target.getPhysicalPath()
        if adding:
            test_path = self.container.getPhysicalPath()
        else:
            test_path = self.ghost.getPhysicalPath()

        # XXX !!!!
        if not adding and len(target_path) > len(test_path):
            if test_path == target_path[:len(test_path)]:
                return errors.CircularInvalidTarget()
        elif target_path == test_path[:len(target_path)]:
                return errors.CircularInvalidTarget()
コード例 #3
0
ファイル: base.py プロジェクト: Python3pkg/Products.Silva
 def modify(self, target, identifier=None):
     if identifier is None:
         identifier = target.getId()
     if IGhostAware.providedBy(target):
         target = target.get_haunted()
     return self.manipulator(self, target, identifier)
コード例 #4
0
ファイル: base.py プロジェクト: silvacms/Products.Silva
 def modify(self, target, identifier=None):
     if identifier is None:
         identifier = target.getId()
     if IGhostAware.providedBy(target):
         target = target.get_haunted()
     return self.manipulator(self, target, identifier)
コード例 #5
0
ファイル: import.py プロジェクト: silvacms/silva.core.smi
 def available(self):
     return not IGhostAware.providedBy(self.content)