noteannotableadapter.py
2008-01-11 19:06...
from noteannotation import NoteAnnotation
from zope.annotation.interfaces import IAnnotations
from interfaces import noteannotationkey, INoteAnnotation
def NoteAnnotableAdapter(context) :
annotations = IAnnotations(context)
try :
na = annotations[noteannotationkey]
except KeyError :
na = annotations[noteannotationkey] = NoteAnnotation()
return INoteAnnotation(na)



