The problem is how to get the contextual document or object from inside the code of a widget.
The answer is to get the datamodel and retrieve the object from it, i.e., test the snippet below in any of the methods of the widget (render, validate, prepare, etc.)
dm = datastructure.getDataModel()
ob = dm.getProxy()
print ob
ob = dm.getObject()
print ob
ob = dm.getContext()
print ob
You can find the original answer in this url http://permalink.gmane.org/gmane.comp.web.zope.cps.devel/3381
No comments:
Post a Comment