Created
June 13, 2011 13:21
-
-
Save pigeonflight/1022753 to your computer and use it in GitHub Desktop.
Hello World Browser View Example
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
<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> | |
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
# 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