> ViewPageTemplate must be in the view's namespace, and it magically
> fishes out the view, view's context and request, and makes them
> available in the TAL namespace.

 Ah, so there _IS_ heavy magic involved here. Thanks for
clarifying that, I was already doubting my sanity!

This is exactly the same magic that methods use. ViewPageTemplateFiles
are, like functions, meant to be used as methods and to be bound to

  Okay, then this leads me to the strong suspicion that what I'm
(mis)using ViewPageTemplateFiles for is the wrong way to attack
the problem.

  What I'm doing is something along the lines of

        class MyView(BrowserView):
            def __call__(self):
pagename = somehow_compute_new_page_name(self.request, self.context)
                pt = ViewPageTemplateFile(pagename)
                return pt.__get__(self, self.__class__)()

  but quite obviously, that's not how it's meant to be used, is it...
Perhaps I need a radically different approach?



Zope3-users mailing list

Reply via email to