def __init__(self, context):
        super(PostInstanceBehaviorAssignable, self).__init__(context)

        if IProject.providedBy(context.aq_parent):
            # project
            self.instance_behaviors = (IProjectContent.__identifier__,)
            alsoProvides(context, IProjectContent)
        else:
            #project workspace
            self.instance_behaviors = (IProjectWorkspaceContent.__identifier__,)
            alsoProvides(context, IProjectWorkspaceContent)
Example #2
0
    def additionalSchemata(self):
        """also yield schemas for our dynamic behaviors because those aren't
        in the fti.
        see project_content.py for information about the dynamic behaviors.
        """
        for schema in super(AddLink, self).additionalSchemata:
            yield schema

        if IProject.providedBy(self.context):
            yield IProjectContent
        elif IProject(self.context, None) is not None:
            yield IProjectWorkspaceContent