Skip to content
Snippets Groups Projects
Commit 024e43e4 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Add the validator IS_IN_USET.

parent c9fc528f
No related branches found
No related tags found
No related merge requests found
......@@ -82,6 +82,7 @@ from helper import (as_list,
from mapper import map_default, map_tabpanel
from navtree import Node
from selector import Selector
from validators import IS_IN_USET
from viewportmodifier import ViewportModifier
UNDEF = 'undefined'
......
# -*- coding: utf-8 -*-
""" validators
@author: R. Le Gac
"""
from gluon.validators import IS_IN_SET
class IS_IN_USET(IS_IN_SET):
"""IS_IN_SET validator but working with unicode string.
"""
def __init__(self, theset, **kwargs):
myset = []
if isinstance(theset, (list, tuple)):
for el in theset:
if isinstance(el, unicode):
el = el.encode("utf-8")
myset.append(el)
elif isinstance(theset, dict):
myset = {}
for key in theset:
if isinstance(key, unicode):
myset[key.encode("utf-8")] = theset[key]
else:
myset[key] = theset[key]
IS_IN_SET.__init__(self, myset, **kwargs)
def __call__(self, value):
if isinstance(value, unicode):
value = value.encode("utf-8")
return IS_IN_SET.__call__(self, value)
\ No newline at end of file
......@@ -3,7 +3,8 @@
HEAD
- Add the plugin App.grid.plugin.Export.
- Mask the whole viewport during loading a PanelWithUrlSelector.
- Version information can be export via the plugin pGridExport.
- Data on version can be export via the plugin pGridExport.
- Add the validator IS_IN_USET.
0.6.1.7 (Sep 2014)
- Use inline script and Ext.grid.Panel to display software versions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment