Created
February 14, 2014 09:53
-
-
Save davisagli/8998503 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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