def __call__(self, request, node, model, viewName):
"""Get a name from my namespace.
"""
from twisted.web.woven import widgets
if viewName == "None":
return widgets.DefaultWidget(model)
vc = getattr(self.namespace, viewName, None)
# don't call modules and random crap in the namespace, only widgets
if vc and isinstance(vc, (type, ClassType)) and issubclass(vc, widgets.Widget):
return vc(model)
评论列表
文章目录