Author: croberts
Date: 2011-09-16 19:52:21 +0000 (Fri, 16 Sep 2011)
New Revision: 4980
Modified:
trunk/cumin/python/cumin/grid/tags.py
Log:
Changes to allow smooth handling of tags with quotes and other potentially problematic
characters in them.
Modified: trunk/cumin/python/cumin/grid/tags.py
===================================================================
--- trunk/cumin/python/cumin/grid/tags.py 2011-09-16 19:51:22 UTC (rev 4979)
+++ trunk/cumin/python/cumin/grid/tags.py 2011-09-16 19:52:21 UTC (rev 4980)
@@ -1,7 +1,7 @@
import logging
from wooly import Widget, Attribute
-from wooly.util import StringCatalog, Writer, escape_amp, escape_entity
+from wooly.util import StringCatalog, Writer, escape_amp, escape_entity, unescape_entity
from wooly.datatable import DataAdapterOptions, DataAdapterField, DataTableColumn,
DataTable, DataAdapter
from wooly.widgets import RadioModeSet, WidgetSet
from wooly.template import WidgetTemplate
@@ -88,7 +88,7 @@
wallaby_features = self.app.wallaby.get_data(WBTypes.FEATURES)
for i, tag in enumerate(wallaby_tags):
- data.append({'Tag':str(tag.name),
'Features':tag.features,
'NumHosts':len(self.app.wallaby.get_node_names(tag)),
'Host':self.app.wallaby.get_node_names(tag)} )
+ data.append({'Tag':str(escape_entity(tag.name)),
'Features':tag.features,
'NumHosts':len(self.app.wallaby.get_node_names(tag)),
'Host':self.app.wallaby.get_node_names(tag)} )
except Exception, e:
log.exception(e)
@@ -302,7 +302,7 @@
class TagColumn(ObjectLinkColumn):
def render_cell_href(self, session, record):
- id = record[self.id_field.index]
+ id = unescape_entity(record[self.id_field.index])
frame = self.page.page_widgets_by_path[self.frame_path]
if isinstance(frame, TagObjectFrame):
@@ -524,8 +524,8 @@
def get_selection(self, session):
''' return the set of checkboxes from the ObjectSelector that were
set in self.ids '''
ids = self.ids.get(session)
-
- selection = list(ids)
+ selection = [escape_entity(id) for id in ids]
+
self.selection.set(session, selection)
return selection
@@ -1204,7 +1204,7 @@
def invoke(self, session, selection):
self.invoc = self.start(session, selection)
-
+ selection = [unescape_entity(text) for text in selection]
try:
self.do_invoke(self.invoc, selection)
except Exception, e:
Show replies by date