src/pyams_alchemy/mixin.py
changeset 43 450c0327037e
parent 34 0926de6c16f4
child 77 2be615fc6da4
--- a/src/pyams_alchemy/mixin.py	Tue Mar 20 17:40:45 2018 +0100
+++ b/src/pyams_alchemy/mixin.py	Thu Mar 22 14:53:53 2018 +0100
@@ -39,9 +39,9 @@
         settings_name = cls.get_schema_settings_name()
         if settings_name:
             registry = get_global_registry()
-            return {'schema': registry.settings.get(settings_name, cls.__schema__)}
-        else:
-            return {'schema': cls.__schema__}
+            if hasattr(registry, 'settings'):
+                return {'schema': registry.settings.get(settings_name, cls.__schema__)}
+        return {'schema': cls.__schema__}
 
     @declared_attr
     def __table_args__(cls):