[Zope] __getitem__ and returning a PageTemplateFile instance

Anders Bruun Olsen anders at bruun-olsen.net
Thu Oct 20 05:52:22 EDT 2005


On Wed, Oct 19, 2005 at 09:47:50PM +0200, Dieter Maurer wrote:
> >Zope has encountered a problem publishing your object.
> >Cannot locate object at: http://localhost:8080/vitester/asonhe 
> This is a "NotFound" problem.
>    Zope is unable to locate "vitester/asonhe"
> Are you sure, "vitester/asonhe" is there?

asonhe is not there, but vitester has a __getitem__ method which
executes a PageTemplateFile instance and returns it. I.e.

return self.test(self, self.REQUEST, value=value)
(where self.test is a PageTemplateFile)

It actually works if I just do:

return self.test.__of__(self)

But that way I can't put any values in there. How can I do this then?
Do I need to make a completely new custom item to return or what?

-- 
Anders
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/O d--@ s:+ a-- C++ UL+++$ P++ L+++ E- W+ N(+) o K? w O-- M- V
PS+ PE@ Y+ PGP+ t 5 X R+ tv+ b++ DI+++ D+ G e- h !r y?
------END GEEK CODE BLOCK------
PGPKey: http://random.sks.keyserver.penguin.de:11371/pks/lookup?op=get&search=0xD4DEFED0


More information about the Zope mailing list