Last active
December 25, 2015 06:19
-
-
Save ichim-david/6931740 to your computer and use it in GitHub Desktop.
browser view with macros property needed for version_history_form preview
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="plone"> | |
<browser:page | |
for="*" | |
name="fiche_view" | |
class=".app.views.FicheView" | |
permission="zope2.View" | |
/> | |
</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
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile | |
from Products.Five.browser import BrowserView | |
class FicheView(BrowserView): | |
index = ViewPageTemplateFile('fiche_view.pt') | |
def __call__(self): | |
# call is needed to return self.index otherwise you get an error | |
# when trying to load a page as such: site/fiche_view | |
return self.index() | |
@property | |
def macros(self): | |
return self.index.macros | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment