[pod,px] 'loop' variable allows to know if we are managing an even or odd elem via loop.<elem>.odd and loop.<elem>.even. [gen] In the process of migrating from ZPT (Zope Page Templates) to appy.px (Python Xml).

This commit is contained in:
Gaetan Delannay 2013-06-27 11:57:39 +02:00
parent e6cacd10dd
commit cb6fea7631
6 changed files with 595 additions and 35 deletions

View file

@ -44,6 +44,11 @@ class ToolMixin(BaseMixin):
tool = self.appy()
return tool.pxHome({'self': tool})
def query(self):
'''Returns the content of px ToolWrapper.pxQuery.'''
tool = self.appy()
return tool.pxQuery({'self': tool})
def getHomePage(self):
'''Return the home page when a user hits the app.'''
# If the app defines a method "getHomePage", call it.
@ -452,9 +457,9 @@ class ToolMixin(BaseMixin):
'''Guess the current layout type, according to actual URL.'''
actualUrl = self.REQUEST['ACTUAL_URL']
res = ''
if actualUrl.endswith('/ui/view'):
if actualUrl.endswith('/view'):
res = 'view'
elif actualUrl.endswith('/ui/edit') or actualUrl.endswith('/do'):
elif actualUrl.endswith('/edit') or actualUrl.endswith('/do'):
res = 'edit'
return res