Updated global registry access
authorThierry Florac <tflorac@ulthar.net>
Thu, 08 Feb 2018 08:51:30 +0100
changeset 34 0926de6c16f4
parent 33 6a493d58a948
child 35 8bf32be8b05b
Updated global registry access
src/pyams_alchemy/mixin.py
--- a/src/pyams_alchemy/mixin.py	Sat Jan 27 00:38:58 2018 +0100
+++ b/src/pyams_alchemy/mixin.py	Thu Feb 08 08:51:30 2018 +0100
@@ -18,9 +18,8 @@
 # import interfaces
 
 # import packages
-from pyramid.threadlocal import get_current_registry
+from pyams_utils.registry import get_global_registry
 from sqlalchemy.ext.declarative import declared_attr
-from zope.component.globalregistry import getGlobalSiteManager
 
 
 class DynamicSchemaMixin(object):
@@ -39,7 +38,7 @@
     def get_schema(cls):
         settings_name = cls.get_schema_settings_name()
         if settings_name:
-            registry = get_current_registry() or getGlobalSiteManager()
+            registry = get_global_registry()
             return {'schema': registry.settings.get(settings_name, cls.__schema__)}
         else:
             return {'schema': cls.__schema__}