Is it possible to register (browser) views based on the request method? E.g. to do something for GET and something else for POST requests?

Currently I do something like this (where FooView is registered as the default view for some interface):

class FooView(BrowserView):


  def __call__(self):
    if self.request.method = POST:
      return self.POST()
    return self.GET()

But I have the feeling this can be done more elegantly. I did notice something in this direction in zope/app/dav/configure.zcml, but I'm not sure this actually helps. It could be I overlook something very very obvious...

Maybe someone has an idea? Any help would be highly appreciated :-)

kind regards,

Jan-Wijbrand Kolman
software developer, Institute for Netherlands History
Zope3-users mailing list

Reply via email to