On Thursday 07 April 2005 16:06, Philipp von Weitershausen wrote: > > class MethodNotAllowed(Exception): > > implements(IMethodNotAllowed) > > > > def __init__(self, object, request): > > self.allow = [name for name, adapter > > in zapi.getAdapters((object, request), Interface) > > if hasattr(adapter, name)] > > > > def __str__(self): > > return 'Allow: %s' % self.allow > > > > > > class MethodNotAllowedView: > > > > def __init__(self, error, request): > > self.error = error > > self.request = request > > > > def __call__(self): > > self.request.response.setHeader('Allow', ', > > '.join(self.error.allow)) self.request.response.setStatus(405) > > return 'Method Not Allowed' > > This looks good. I'm +1 on this.
+1 I think this is a first good step. We have to think about the special cases a bit harder. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training _______________________________________________ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com