--- a/src/pyams_utils/timezone/vocabulary.py Tue Nov 15 10:43:03 2016 +0100
+++ b/src/pyams_utils/timezone/vocabulary.py Tue Nov 15 10:43:55 2016 +0100
@@ -17,19 +17,16 @@
import pytz
# import interfaces
-from zope.schema.interfaces import IVocabularyFactory
# import packages
-from zope.interface import provider
-from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary, getVocabularyRegistry
+from pyams_utils.vocabulary import vocabulary_config
+from zope.schema.vocabulary import SimpleTerm, SimpleVocabulary
-@provider(IVocabularyFactory)
+@vocabulary_config(name='PyAMS timezones')
class TimezonesVocabulary(SimpleVocabulary):
"""Timezones vocabulary"""
def __init__(self, *args, **kw):
terms = [SimpleTerm(t, t, t) for t in pytz.all_timezones]
super(TimezonesVocabulary, self).__init__(terms)
-
-getVocabularyRegistry().register('PyAMS timezones', TimezonesVocabulary)