Exemple #1
0
def may_reindex_directory(directory):
    if not directory:
        return False

    if hasattr(directory, '_v_fetching') and getattr(directory, '_v_fetching'):
        return False

    if not IEventsDirectory.providedBy(directory):
        return False

    return True
Exemple #2
0
def may_reindex_directory(directory):
    if not directory:
        return False

    if hasattr(directory, '_v_fetching') and getattr(directory, '_v_fetching'):
        return False

    if not IEventsDirectory.providedBy(directory):
        return False

    return True
    def custom_directory(self, directory):
        """ Return the custom directory from which title, description and
        image are loaded if a page id is found in the request.

        Returns the given directory if the custom directory cannot be found.

        """
        props = self.properties(directory)
        path = props.get('directory')

        if not path:
            return directory

        obj = getSite().unrestrictedTraverse(str(path))
        if IEventsDirectory.providedBy(obj):
            return obj
        else:
            return directory