Skip to content

Instantly share code, notes, and snippets.

@pigeonflight
Created June 13, 2011 13:21
Show Gist options
  • Save pigeonflight/1022753 to your computer and use it in GitHub Desktop.
Save pigeonflight/1022753 to your computer and use it in GitHub Desktop.
Hello World Browser View Example
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="your.product">
<!-- this is browser/configure.zcml
without the allowed_attributes I get a permission error -->
<browser:page
name="helloview"
for="*"
permission="zope2.View"
allowed_attributes="hellojamaica"
class=".views.Hello"
/>
</configure>
# browser/views.py
from Products.Five import BrowserView
# from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
class Hello(BrowserView):
"""
End user visible product card presentation.
"""
# the __init__ triggered a permission issue
#def __init__(self,context,request):
# return "hello world"
def hellojamaica(self):
""" Render hello
"""
return "hello jamaica"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment