[Grok-dev] grok error page customization, DRY

Jasper Spaans jasper at vs19.net
Mon Aug 18 10:48:48 EDT 2008


Hi list,

Today, I was working on a custom error page, and got bitten by the  
fact that it needs a grok.name('index.html'):

from zope.publisher.interfaces import INotFound
from zope.app.exception.systemerror import SystemErrorView
...
class CobesNotFound(grok.View, SystemErrorView):
     grok.context(INotFound)
     grok.template('notfound')
     grok.name('index.html')

     def update(self):
         _set_no_cache_headers(self.response)
         self.response.setStatus(404)


This feels like I'm repeating myself, so is there some way to fix this?


Jasper



More information about the Grok-dev mailing list