Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
R
Rule Engine Service
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
brooklyn
Rule Engine Service
Commits
b117bd19
Commit
b117bd19
authored
Jan 09, 2023
by
Sarah Abrishami
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added validators
parent
02eb2a7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
app/main/views/validators.py
app/main/views/validators.py
+23
-0
No files found.
app/main/views/validators.py
0 → 100644
View file @
b117bd19
from
app.main
import
main
from
app.main.utils.common
import
response_message
from
flask
import
json
from
rulemall.validators
import
*
@
main
.
route
(
'/validators'
,
methods
=
[
'GET'
,
'POST'
])
def
validators
():
vals
=
[]
for
val
in
[
Range
,
Length
,
Category
,
Regex
,
Missing
,
Unique
,
Empty
]:
v
=
val
()
vals
.
append
(
json
.
loads
(
str
(
v
)))
return
response_message
(
vals
)
@
main
.
route
(
'/validators/<val>'
,
methods
=
[
'GET'
,
'POST'
])
def
get_validator
(
val
):
dct
=
{
'Range'
:
Range
,
'Length'
:
Length
,
'Category'
:
Category
,
'Regex'
:
Regex
,
'Missing'
:
Missing
,
'Unique'
:
Unique
,
'Empty'
:
Empty
}
v
=
dct
[
val
]()
return
response_message
(
json
.
loads
(
str
(
v
)))
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