[Zope-dev] Who uses request.getPositionalArguments()?

Christian Theune ct at gocept.com
Tue Jun 9 10:36:05 EDT 2009


Hi,

On Tue, 2009-06-09 at 10:02 -0400, Stephan Richter wrote:
> On Tuesday 09 June 2009, Wolfgang Schnerring wrote:
> > I've stumbled over this by accident, but it seems that
> > getPositionalArguments() in zope.publisher.base.BaseRequest
> > always returns an empty value (at least, there are no tests in which
> > it has a non-empty value), and it is also not overridden by any of the
> > request subclasses in zope.publisher.
> >
> > I still haven't quite wrapped my head around the whole publishing
> > machinery, but this strikes me as a little strange, nonetheless.
> >
> > Could somebody enlighten me why this is so?
> 
> I think this may be a remnant of Zope 2's version of the publisher. The method 
> should be used in mapply() to provide the correct arguments to the method to 
> be called at the end of traversal, but these days we usually do not implement 
> methods that expect any arguments, in fact the common case is this:
> 
> class View(BrowserView):
> 
>   def __call__(self):
>        return ...

Actually, I find myself sometimes doing this:

class View(object):

    def foo(self, x, y)
        return x+y

    def bar(self, a, b):
        return x*y

<browser:page
    name="foo"
    class="View"
    attribute="foo"
    />

<browser:page
    name="bar"
    class="View"
    attribute="bar"
    />

It's a convenience thing but it pops up here and there.

Christian

-- 
Christian Theune · ct at gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1
Zope and Plone consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20090609/b3406893/attachment.bin 


More information about the Zope-Dev mailing list