[Zope3-Users] Re: ZopeX3 Component Architecture in comparision to MVC - general question/example

Darryl Cousins darryl at darrylcousins.net.nz
Wed Mar 1 23:01:56 EST 2006


Hi Reinhold,

Here's another go at answering your case, this came about when last
night I added a source view to a RESTDocument content, it might come
closer to what you are looking at because it doesn't use tal templates
at all and secondly the request is available - so you can pass in
arguments to your calculator. My starting point for the code is from
zope.app.file.browser.file. 

Best regards,
Darryl

  <!-- restdocument source view -->
  <page
      name="source.txt"
      for="..IPortalRestDocument"
      class=".views.PortalRestDocumentSourceView"
      permission="zope.Public"
      attribute="show"
      />

class PortalRestDocumentSourceView(BrowserView):
    """A RestDocument source view."""

    def show(self):
        """Call the source view of restdocument"""
        request = self.request
        if request is not None:
            request.response.setHeader('Content-Type',
                                       'text/plain')

        return self.context.body

On Tue, 2006-02-28 at 17:52 +0100, Lennart Regebro wrote:
> On 2/28/06, Reinhold Strobl <reinhold.strobl at gmx.net> wrote:
> > Thanks for the reply. But how would you implement previously described task with
> > the calculator?
> 
> I would implement it as a view on whatever object I want to view it
> on. Which may even be "*", that is any object.
> 
> --
> Lennart Regebro, Nuxeo     http://www.nuxeo.com/
> CPS Content Management     http://www.cps-project.org/
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
-- 
Darryl Cousins
Tree Fern Web Services (NZ) Ltd
106 Sandes St
Thames 2801
New Zealand
+64 7 868 3139
darryl.cousins at treefernwebservices.co.nz
http://www.treefernwebservices.co.nz/



More information about the Zope3-users mailing list