You register your python as Views in the content object:
<browser:page
for="**INTERFACE**"
name="**name**"
class="**class**"
attribute="**method**"
permission="zope2.View"
/>
- , ,
- (.. http://path-to-object/@@name),
- Python, script, - ( __ __). , , - , .
script, kss ( , AJAX) - BrowserView (PloneKSSView - KSS):
<browser:page
for="Products.VirtualDataCentre.interfaces.IDDCode"
name="getTableColumns"
class="Products.VirtualDataCentre.browser.DDActions.DDActions"
attribute="getTableColumns"
permission="zope2.View"
/>
IDDCode - , , DDActions.py:
from Products.Five import BrowserView
from plone.app.kss.plonekssview import PloneKSSView
class DDActions(PloneKSSView):
def getTableColumns(self, table, currValue, currLabel):
columns = self.context.getColumnNames(table)
for (field, curr) in [('valueColumn', currValue), ('labelColumn',currLabel)]:
self.replaceSelect(field, columns, (curr or self.context[field]))
source
share