Back to index

plone3  3.1.7
Classes | Functions
plone.portlets.assignable Namespace Reference

Classes

class  LocalPortletAssignmentManager

Functions

def localPortletAssignmentMappingAdapter

Function Documentation

When adapting (context, manager), get an IPortletAssignmentMapping
by finding one in the object's annotations. The container will be created
if necessary.

Definition at line 21 of file assignable.py.

00021 
00022 def localPortletAssignmentMappingAdapter(context, manager):
00023     """When adapting (context, manager), get an IPortletAssignmentMapping
00024     by finding one in the object's annotations. The container will be created
00025     if necessary.
00026     """
00027     annotations = IAnnotations(context)
00028     local = annotations.get(CONTEXT_ASSIGNMENT_KEY, None)
00029     if local is None:
00030         local = annotations[CONTEXT_ASSIGNMENT_KEY] = OOBTree()
00031     portlets = local.get(manager.__name__, None)
00032     if portlets is None:
00033         portlets = local[manager.__name__] = PortletAssignmentMapping(manager=manager.__name__,
00034                                                                       category=CONTEXT_CATEGORY)
00035     return portlets
00036