Commit d27b5a57 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Remove obsolete plugin_dbui/validator (IS_IN_USET).

parent 0e8bbdd2
...@@ -93,5 +93,4 @@ from .helper import (as_list, ...@@ -93,5 +93,4 @@ from .helper import (as_list,
from .mapper import map_default, map_tabpanel from .mapper import map_default, map_tabpanel
from .navtree import Node from .navtree import Node
from .selector import Selector from .selector import Selector
from .validator import IS_IN_USET
from .viewportmodifier import ViewportModifier from .viewportmodifier import ViewportModifier
""" validator
from gluon.validators import 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, str):
el = el.encode("utf-8")
elif isinstance(theset, dict):
myset = {}
for key in theset:
if isinstance(key, str):
myset[key.encode("utf-8")] = theset[key]
myset[key] = theset[key]
IS_IN_SET.__init__(self, myset, **kwargs)
def __call__(self, value):
if isinstance(value, str):
value = value.encode("utf-8")
return IS_IN_SET.__call__(self, value)
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