Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
21_22-J 38
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
21_22-J 38
21_22-J 38
Commits
5800bb45
Commit
5800bb45
authored
Feb 10, 2022
by
W.D.R.P. Sandeepa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create getColorActivitiesResult function
parent
9bbc61d3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
23 deletions
+47
-23
API/app.py
API/app.py
+9
-8
API/db/__pycache__/dbConnection.cpython-39.pyc
API/db/__pycache__/dbConnection.cpython-39.pyc
+0
-0
API/db/dbConnection.py
API/db/dbConnection.py
+2
-13
API/model/__pycache__/colorModel.cpython-39.pyc
API/model/__pycache__/colorModel.cpython-39.pyc
+0
-0
API/model/colorModel.py
API/model/colorModel.py
+36
-2
No files found.
API/app.py
View file @
5800bb45
from
flask
import
Flask
,
redirect
,
url_for
,
render_template
,
request
,
jsonify
,
make_response
from
API.model.colorModel
import
get_color_activities
from
API.model.colorModel
import
get_color_activities
,
get_color_activity_result
from
API.model.readModel
import
get_reading_activities
from
API.routers.router
import
funtion_one
...
...
@@ -16,7 +16,12 @@ def home():
# Color Function Route (IT18218640)
@
app
.
route
(
"/getColorActivities"
)
def
getColorActivities
():
return
get_color_activities
()
return
get_color_activities
()
\
@
app
.
route
(
"/getColorActivitiesResult"
)
def
getColorActivitiesResult
():
# print("data_dic")
return
get_color_activity_result
()
# Read Function Route (IT)
...
...
@@ -45,11 +50,7 @@ def abc():
if
__name__
==
"__main__"
:
<<<<<<<
HEAD
app
.
run
(
host
=
'192.168.8.102'
)
=======
app
.
run
(
host
=
'192.168.8.101'
)
app
.
run
(
host
=
'192.168.8.100'
)
# app.run(host='192.168.8.100,port='5000', debug=True)
# app.run(debug=True)
>>>>>>>
ef01cf5d3888e989084c7d61dff42b160793ac0a
API/db/__pycache__/dbConnection.cpython-39.pyc
View file @
5800bb45
No preview for this file type
API/db/dbConnection.py
View file @
5800bb45
...
...
@@ -24,24 +24,13 @@ def create_con_pandas():
def
get_all_data
(
query
):
data_dic
=
[]
db
=
create_con
()
cursor
=
db
.
cursor
()
cursor
.
execute
(
query
)
result
=
cursor
.
fetchall
()
for
row
in
result
:
ob
=
{
"idcolorActivities"
:
row
[
0
],
"name"
:
row
[
1
],
"file"
:
row
[
2
],
"des"
:
row
[
3
],
"color"
:
row
[
4
],
}
data_dic
.
append
(
ob
)
return
jsonify
(
data_dic
)
return
result
def
get_reading_data
(
query
):
...
...
API/model/__pycache__/colorModel.cpython-39.pyc
View file @
5800bb45
No preview for this file type
API/model/colorModel.py
View file @
5800bb45
from
flask
import
jsonify
from
API.db.dbConnection
import
get_all_data
def
get_color_activities
():
data_dic
=
[]
qry
=
'SELECT * FROM coloractivities'
response
=
get_all_data
(
qry
)
result
=
get_all_data
(
qry
)
for
row
in
result
:
ob
=
{
"idcolorActivities"
:
row
[
0
],
"name"
:
row
[
1
],
"file"
:
row
[
2
],
"des"
:
row
[
3
],
"color"
:
row
[
4
],
}
data_dic
.
append
(
ob
)
return
jsonify
(
data_dic
)
def
get_color_activity_result
():
data_dic
=
[]
qry
=
'SELECT * FROM coloractivityresult'
result
=
get_all_data
(
qry
)
for
row
in
result
:
ob
=
{
"idcoloractivityresult"
:
row
[
0
],
"idcolorActivities"
:
row
[
1
],
"date"
:
row
[
2
],
"time"
:
row
[
3
],
"result"
:
row
[
4
],
}
data_dic
.
append
(
ob
)
return
response
return
jsonify
(
data_dic
)
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