API

Interfaces

Utility for storing IAnnotations for principals.

interface zope.principalannotation.interfaces.IPrincipalAnnotationUtility[source]

Stores IAnnotations for IPrinicipals.

getAnnotations(principal)

Return object implementing IAnnotations for the given :class`~.IPrinicipal`.

If there is no IAnnotations it will be created and then returned.

getAnnotationsById(principalId)

Return object implementing IAnnotations for the given prinicipalId.

If there is no IAnnotations it will be created and then returned.

hasAnnotations(principal)

Return boolean indicating if given IPrincipal has IAnnotations.

Utility and Adapters

Implementation of IPrincipalAnnotationUtility

class zope.principalannotation.utility.PrincipalAnnotationUtility[source]

Bases: persistent.Persistent

Stores IAnnotations for IPrinicipals.

The utility ID is ‘PrincipalAnnotation’.

getAnnotations(principal)[source]

See IPrincipalAnnotationUtility.getAnnotations().

getAnnotationsById(principalId)[source]

See IPrincipalAnnotationUtility.getAnnotationsById().

hasAnnotations(principal)[source]

See IPrincipalAnnotationUtility.hasAnnotations().

class zope.principalannotation.utility.Annotations(principalId, store=None)[source]

Bases: persistent.Persistent, zope.location.location.Location

Stores annotations for a single principal in a PersistentDict.

Cooperates with the site hierarchy to find annotations in parent sites.