Updated decorators to set module name
authorThierry Florac <thierry.florac@onf.fr>
Mon, 11 Jun 2018 15:44:10 +0200
changeset 20 918e27541429
parent 19 a102c906d1db
child 21 3c93821dffeb
Updated decorators to set module name
src/pyams_viewlet/viewlet.py
--- a/src/pyams_viewlet/viewlet.py	Fri Apr 27 10:23:24 2018 +0200
+++ b/src/pyams_viewlet/viewlet.py	Mon Jun 11 15:44:10 2018 +0200
@@ -90,7 +90,10 @@
         settings = self.__dict__.copy()
 
         def callback(context, name, ob):
-            cdict = {'__name__': settings.get('name')}
+            cdict = {
+                '__name__': settings.get('name'),
+                '__module__': ob.__module__
+            }
             if 'permission' in settings:
                 settings['permission'] = settings.get('permission')
 
@@ -171,7 +174,10 @@
         settings = self.__dict__.copy()
 
         def callback(context, name, ob):
-            cdict = {'__name__': settings.get('name')}
+            cdict = {
+                '__name__': settings.get('name'),
+                '__module__': ob.__module__
+            }
             if 'permission' in settings:
                 cdict['permission'] = settings.get('permission')
             if 'weight' in settings: