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
08047259
Commit
08047259
authored
Jan 07, 2023
by
Sarah Abrishami
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated rulemall and other functions based on changes
parent
82396a66
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
app/main/views/rulegroup.py
app/main/views/rulegroup.py
+1
-1
app/main/views/validate.py
app/main/views/validate.py
+6
-2
wheels/Rulemall-0.1-py3-none-any.whl
wheels/Rulemall-0.1-py3-none-any.whl
+0
-0
No files found.
app/main/views/rulegroup.py
View file @
08047259
...
...
@@ -17,7 +17,7 @@ def create_rg(rsid):
try
:
configs
=
{
'name'
:
req
[
'name'
],
'rules'
:
req
[
'rules'
],
'created_date'
:
str
(
datetime
.
now
()),
'modified_date'
:
str
(
datetime
.
now
())}
rg
=
RulesGroup
()
.
from_dict
(
configs
)
RulesGroup
()
.
from_dict
(
configs
.
copy
()
)
return
response_message
(
add_rg
(
rsid
,
configs
))
except
Exception
as
e
:
return
response_message
(
str
(
e
),
500
)
...
...
app/main/views/validate.py
View file @
08047259
...
...
@@ -8,16 +8,20 @@ from datetime import datetime
@
main
.
route
(
'/validate/<rsid>/<rgid>'
,
methods
=
[
'GET'
,
'POST'
])
def
validate
(
rsid
,
rgid
):
configs
,
rs
=
read_rules
(
rsid
,
rgid
,
where
=
'db'
)
rg
=
RulesGroup
()
.
from_dict
(
configs
)
print
(
'got rules'
)
rg
=
RulesGroup
()
rg
.
from_dict
(
configs
)
# cols = rg.get_target()
data
=
read_data
(
rsid
,
rs
)
print
(
'got data'
)
rg
.
reset_data
(
data
)
validation
,
responsible
=
rg
.
validate
()
print
(
'validated'
)
validation
=
pd
.
concat
([
validation
.
rename
(
'validation'
),
responsible
],
axis
=
1
)
validation
=
validation
.
reset_index
()
.
rename
(
columns
=
{
'index'
:
'rid'
})
# TODO return rule group id
validation
[
'rgid'
]
=
rgid
validation
[
'created_date'
]
=
datetime
.
now
()
validation
[
'modified_date'
]
=
datetime
.
now
()
result
=
write_validations
(
validation
)
result
=
write_validations
(
validation
,
where
=
'db'
)
return
response_message
(
result
)
wheels/Rulemall-0.1-py3-none-any.whl
View file @
08047259
No preview for this file type
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