Grid framework fixes, including extension of sanitize_text to work with lists of text.

This commit is contained in:
Jeremy Goecks
2013-02-14 13:48:52 -05:00
parent 0a321d5dc4
commit 53352f18b0
3 changed files with 14 additions and 3 deletions
+12 -1
View File
@@ -196,7 +196,18 @@ def restore_text(text):
return text
def sanitize_text(text):
"""Restricts the characters that are allowed in a text"""
"""
Restricts the characters that are allowed in text; accepts both strings
and lists of strings.
"""
if isinstance( text, basestring ):
return _sanitize_text_helper(text)
elif isinstance( text, list ):
return [ _sanitize_text_helper(t) for t in text ]
def _sanitize_text_helper(text):
"""Restricts the characters that are allowed in a string"""
out = []
for c in text:
if c in valid_chars:
+1 -1
View File
@@ -48,7 +48,7 @@ var Grid = Backbone.Model.extend({
// Update URL arg with new condition.
if (append) {
// Update or append value.
var cur_val = this.attributes.key,
var cur_val = this.attributes.filters[key],
new_val;
if (cur_val === null || cur_val === undefined) {
new_val = value;
File diff suppressed because one or more lines are too long