Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
tev
plugin_event
Commits
ff99d2a4
Commit
ff99d2a4
authored
Jan 22, 2016
by
LE GAC Renaud
Browse files
Remove the validator IS_IN_USET. It is in plugin_dbui and not used here.
parent
fe6278a4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
3 additions
and
93 deletions
+3
-93
docs/api/generated/is_in_uset/my_validators.IS_IN_USET.formatter.rst
...nerated/is_in_uset/my_validators.IS_IN_USET.formatter.rst
+0
-6
docs/api/generated/is_in_uset/my_validators.IS_IN_USET.options.rst
...generated/is_in_uset/my_validators.IS_IN_USET.options.rst
+0
-6
docs/api/generated/my_validators.IS_IN_USET.rst
docs/api/generated/my_validators.IS_IN_USET.rst
+0
-18
docs/api/index.rst
docs/api/index.rst
+0
-1
docs/api/report.rst
docs/api/report.rst
+3
-3
docs/api/validator.rst
docs/api/validator.rst
+0
-14
models/common_settings.py
models/common_settings.py
+0
-1
modules/my_validators.py
modules/my_validators.py
+0
-44
No files found.
docs/api/generated/is_in_uset/my_validators.IS_IN_USET.formatter.rst
deleted
100644 → 0
View file @
fe6278a4
my_validators.IS_IN_USET.formatter
==================================
.. currentmodule:: my_validators
.. automethod:: IS_IN_USET.formatter
\ No newline at end of file
docs/api/generated/is_in_uset/my_validators.IS_IN_USET.options.rst
deleted
100644 → 0
View file @
fe6278a4
my_validators.IS_IN_USET.options
================================
.. currentmodule:: my_validators
.. automethod:: IS_IN_USET.options
\ No newline at end of file
docs/api/generated/my_validators.IS_IN_USET.rst
deleted
100644 → 0
View file @
fe6278a4
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
docs/api/index.rst
View file @
ff99d2a4
...
...
@@ -12,7 +12,6 @@ API Documentation
callback
report
selector
validator
Indices and tables
==================
...
...
docs/api/report.rst
View file @
ff99d2a4
Report
object
s
-------
-------
Reports
-------
A collection of methods and classes to build report: *list*, *graph* or
*metric
s
*.
*metric*.
Helper functions
^^^^^^^^^^^^^^^^
...
...
docs/api/validator.rst
deleted
100644 → 0
View file @
fe6278a4
Validators
----------
Classes
^^^^^^^
.. currentmodule:: my_validators
.. autosummary::
:toctree: generated/
~IS_IN_USET
models/common_settings.py
View file @
ff99d2a4
...
...
@@ -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
#-------------------------------------------------------------------------------
#
...
...
modules/my_validators.py
deleted
100644 → 0
View file @
fe6278a4
""" 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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment