Re: Problem Understanding URL

Jared Hall <JHall-CjZoFDOIhHZ8UrSeD/[email protected]>
Newsgroups gmane.comp.web.zope.general
Message-ID <[email protected]>
Ok I'd read about those functions a little bit in the Zope 2 book or the Developer's Guide, but they seemed like advanced techniques that I probably wouldn't need to understand.

Back on topic; I ran this awesome command in the terminal:

grep getitem x=$(find . *.*)

and turned up some random references to getitem in some dtml code, which I judge to be insignificant. There was also one very interesting usage of __getitem__ in the python code itself, and I have to investigate the code further to understand what's going on. The function definition looks suspiciously like what I would expect to find for this 'hijacking' of control:

def __getitem__(self, key):
v=self._getOb(key, None)
        if v is not None: return v
        if hasattr(self, 'REQUEST'):
            request=self.REQUEST
            method=request.get('REQUEST_METHOD', 'GET')
            if request.maybe_webdav_client and not method in ('GET', 'POST'):
                return NullResource(self, key, request).__of__(self)
        raise KeyError, key

I read this as: look up the object in the current context and return it. The only problem with this is that I don't see when the object gets placed into the proper context for the TAL statements like here/FirstName, etc.

Thanks for your help already, and any continued guidance is appreciated.

_______________________________________________
Zope maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.