--- a/src/pyams_sequence/sequence.py Mon May 28 12:16:30 2018 +0200
+++ b/src/pyams_sequence/sequence.py Mon May 28 14:05:56 2018 +0200
@@ -17,11 +17,10 @@
# import interfaces
from pyams_sequence.interfaces import ISequentialIdInfo, ISequentialIdTarget, ISequentialIntIds
-from zope.annotation.interfaces import IAnnotations
# import packages
from persistent import Persistent
-from pyams_utils.adapter import adapter_config
+from pyams_utils.adapter import adapter_config, get_annotation_adapter
from pyams_utils.registry import get_utility
from zope.interface import implementer
from zope.schema.fieldproperty import FieldProperty
@@ -53,8 +52,5 @@
@adapter_config(context=ISequentialIdTarget, provides=ISequentialIdInfo)
def sequential_id_info_factory(context):
"""Sequential ID info factory"""
- annotations = IAnnotations(context)
- info = annotations.get(SEQUENCE_INFO_KEY)
- if info is None:
- info = annotations[SEQUENCE_INFO_KEY] = SequentialIdInfo()
- return info
+ return get_annotation_adapter(context, SEQUENCE_INFO_KEY, SequentialIdInfo,
+ notify=False, locate=False)