Skip to content

Instantly share code, notes, and snippets.

@davisagli
Created February 14, 2014 09:53
Show Gist options
  • Save davisagli/8998503 to your computer and use it in GitHub Desktop.
Save davisagli/8998503 to your computer and use it in GitHub Desktop.
from Products.Five import BrowserView
from zope.interface import implementer
from zope.publisher.interfaces.browser import IPublishTraverse
@implementer(IPublishTraverse)
class AuthorView(BrowserView):
user_id = None
def publishTraverse(self, request, name):
self.user_id = name
return self
# Now the template can use view/user_id and other view code can use view.user_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment