Easyform custom script getting a view

I'm working with the custom script functionality in easy form and - yup, restricted python!

How can I call a named browser view?

from plone import api
api.content.get_view(....) #throws error - restricted module

And If that's is the right way to do it, how can I authorize a module?
docs seem a bit broken around this.

And lastly, would it be a good idea for easyform to allow an action to call a view by name, instead of going through RestrictedPython?

It should be possible to use

view = context.restrictedTraverse('@@some_view')
result = view()
return result

or something similar.


1 Like