Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
plugin_dbui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
w2pext
plugin_dbui
Commits
024e43e4
Commit
024e43e4
authored
10 years ago
by
LE GAC Renaud
Browse files
Options
Downloads
Patches
Plain Diff
Add the validator IS_IN_USET.
parent
c9fc528f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/plugin_dbui/__init__.py
+1
-0
1 addition, 0 deletions
modules/plugin_dbui/__init__.py
modules/plugin_dbui/validators.py
+42
-0
42 additions, 0 deletions
modules/plugin_dbui/validators.py
static/plugin_dbui/CHANGELOG
+2
-1
2 additions, 1 deletion
static/plugin_dbui/CHANGELOG
with
45 additions
and
1 deletion
modules/plugin_dbui/__init__.py
+
1
−
0
View file @
024e43e4
...
...
@@ -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
'
...
...
This diff is collapsed.
Click to expand it.
modules/plugin_dbui/validators.py
0 → 100644
+
42
−
0
View file @
024e43e4
# -*- 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
This diff is collapsed.
Click to expand it.
static/plugin_dbui/CHANGELOG
+
2
−
1
View file @
024e43e4
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment