[z3-five] Adaptation in untrusted code
Chris Withers
chris at simplistix.co.uk
Thu Nov 16 10:22:52 CET 2006
Martin Aspeli wrote:
> Chris Withers wrote:
>> Hi All,
>>
>> I need to do the following in a python script or a page template:
>>
>> IRender(obj).render(context)
>
> I think you need a view. :)
Indeed. Can you give me a simple example of how you'd do this as a view?
Philipp said that views adapt the request, whereas no request is
involved here and nor do I want it do be...
>> ...in my adapter code. How can I go about doing this?
>
> You can do allowed_attributes="render" and permission="zope2.View" on
> the <adapter /> statement, I believe.
Nope, adapter has no "allowed_attributes" attribute.
> You're sure it's the render() bit that's failing
Yes.
> Honestly,
> I've never tried, it just seemed really wrong to put Zope 3 stuff into
> Script (Python)'s. :)
Why?
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
More information about the z3-five
mailing list