Commit 3fdd3064 authored by Jérome Perrin's avatar Jérome Perrin

fix some undefined names


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16769 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4ef7d621
...@@ -107,10 +107,10 @@ class ZPyChartWidget(Widget.Widget): ...@@ -107,10 +107,10 @@ class ZPyChartWidget(Widget.Widget):
# Retrieve the data and set the selection if data_method is not None # Retrieve the data and set the selection if data_method is not None
if data_method: if data_method:
if hasattr(here, data_method):
data_method = getattr(here,data_method)
# Retrieve selection
here = REQUEST.get('here', self) here = REQUEST.get('here', self)
if getattr(here, data_method, None) is not None:
data_method = getattr(here, data_method)
# Retrieve selection
selection = here.portal_selections.getSelectionFor(selection_name, REQUEST=REQUEST) selection = here.portal_selections.getSelectionFor(selection_name, REQUEST=REQUEST)
# Define the new selection data_method # Define the new selection data_method
selection.edit(method_id = data_method) # XXX This is probably wrong selection.edit(method_id = data_method) # XXX This is probably wrong
...@@ -149,7 +149,7 @@ class ZPyChart(ZMIField, PythonScript): ...@@ -149,7 +149,7 @@ class ZPyChart(ZMIField, PythonScript):
ZMIField.__init__(self, id, **kw) ZMIField.__init__(self, id, **kw)
PythonScript.__init__(self, id) PythonScript.__init__(self, id)
def download(self, selection_name=None, data_method=None, **kw): def download(self, selection_name=None, data_method=None, REQUEST=None, **kw):
""" """
This is where we actually render the chart. The main interest This is where we actually render the chart. The main interest
of doing like this is to accelerate initial rendering of doing like this is to accelerate initial rendering
...@@ -168,6 +168,7 @@ class ZPyChart(ZMIField, PythonScript): ...@@ -168,6 +168,7 @@ class ZPyChart(ZMIField, PythonScript):
# Get the data method if defined # Get the data method if defined
if data_method is not None: if data_method is not None:
here = REQUEST.get('here', self)
data_method = getattr(here, data_method, None) data_method = getattr(here, data_method, None)
# This is the default data, this is just in the case there is not method given # This is the default data, this is just in the case there is not method given
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment