Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

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

Remove the validator IS_IN_USET. It is in plugin_dbui and not used here.

parent fe6278a4
my_validators.IS_IN_USET.formatter
==================================
.. currentmodule:: my_validators
.. automethod:: IS_IN_USET.formatter
\ No newline at end of file
my_validators.IS_IN_USET.options
================================
.. currentmodule:: my_validators
.. automethod:: IS_IN_USET.options
\ No newline at end of file
my_validators.IS_IN_USET
========================
.. currentmodule:: my_validators
.. autoclass:: IS_IN_USET
:show-inheritance:
.. autosummary::
:toctree: is_in_uset/
~IS_IN_USET.formatter
~IS_IN_USET.options
......@@ -12,7 +12,6 @@ API Documentation
callback
report
selector
validator
Indices and tables
==================
......
Report objects
--------------
Reports
-------
A collection of methods and classes to build report: *list*, *graph* or
*metrics*.
*metric*.
Helper functions
^^^^^^^^^^^^^^^^
......
Validators
----------
Classes
^^^^^^^
.. currentmodule:: my_validators
.. autosummary::
:toctree: generated/
~IS_IN_USET
......@@ -8,7 +8,6 @@ import plugin_dbui as dbui
from datetime import datetime
from callbacks import INHIBIT_CASCADE_DELETE
from gluon.tools import PluginManager
from my_validators import IS_IN_USET
#-------------------------------------------------------------------------------
#
......
""" Custom validators.
"""
from gluon.validators import IS_IN_SET
class IS_IN_USET(IS_IN_SET):
"""IS_IN_SET validator but working with unicode string.
Args:
theset (list or tuple or dict):
the reference set containing utf-8 strings.
Keyword Args:
**kwargs (dict):
the keyword arguments of the validator ``IS_IN_SET``.
"""
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)
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