[Zope3-Users] Understanding viewlets and content providers

Graham Stratton gns24 at mythic-beasts.com
Tue Jun 24 01:15:54 EDT 2008


Hi,

I've been using viewlets for a couple of projects, and have found them  
very useful and a very good fit with the CA. Unfortunately I am  
failing to understand how they're meant to work with regards to the  
update/render pattern. According to the zope.contentprovider interface  
specifications:

- the update method should update persistent objects based on the  
request. It should not store state about persistent objects.
- the render method should then return HTML based on the state of  
persistent objects

Which is fine providing all content providers have their update  
methods called and then their render methods called. But using the  
tal:provider expression just calls the update and then render methods  
on one content provider, and then moves on to the next one. The  
expression implementation's docstring says: "If you want to implement  
interdependent content providers, you need to consider a TAL- 
independent view implementation that will complete all content  
providers' stage one before rendering any of them."

Does a TAL-independent view implementation exist? What do other people  
using viewlets do?

Until now I've been issuing a redirect after any update to persistent  
objects. I've also been abusing the update method for calculating  
values for the template. I'll stop that now!

Many thanks,

Graham


More information about the Zope3-users mailing list