--- a/src/pyams_pagelet/pagelet.py Sat Jan 27 00:41:01 2018 +0100
+++ b/src/pyams_pagelet/pagelet.py Sat Jun 09 00:45:28 2018 +0200
@@ -127,15 +127,17 @@
depth = settings.pop('_depth', 0)
def callback(context, name, ob):
- cdict = {}
- cdict['__name__'] = settings.get('name')
- cdict['permission'] = settings.get('permission')
+ cdict = {
+ '__name__': settings.get('name'),
+ '__module__': ob.__module__,
+ 'permission': settings.get('permission')
+ }
new_class = type(ob.__name__, (ob, Pagelet), cdict)
config = context.config.with_package(info.module)
logger.debug('Registering pagelet view "{0}" for {1} ({2})'.format(settings.get('name'),
str(settings.get('context', Interface)),
- str(ob)))
+ str(new_class)))
config.registry.registerAdapter(new_class,
(settings.get('context', Interface),
settings.get('request_type', IRequest)),