Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProjectClient_Y1S1_tramshedTech_team15
Manage
Activity
Members
Labels
Plan
Issues
7
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Arianne Bayliss
ProjectClient_Y1S1_tramshedTech_team15
Commits
71df99e9
Commit
71df99e9
authored
2 years ago
by
Liam Driscoll
Browse files
Options
Downloads
Patches
Plain Diff
getWorkingSpaces function.
parent
fa10521c
No related branches found
Branches containing commit
No related tags found
3 merge requests
!20
Draft: resolving merge conflicts
,
!19
Development
,
!13
getWorkingSpaces function.
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
static/Coworking_Functions.py
+16
-0
16 additions, 0 deletions
static/Coworking_Functions.py
static/__pycache__/coworking_functions.cpython-310.pyc
+0
-0
0 additions, 0 deletions
static/__pycache__/coworking_functions.cpython-310.pyc
tempServer.py
+7
-16
7 additions, 16 deletions
tempServer.py
with
23 additions
and
16 deletions
static/Coworking_Functions.py
+
16
−
0
View file @
71df99e9
from
flask
import
request
from
csv
import
writer
from
csv
import
writer
def
getCoworkingSpaces
():
recordName
=
request
.
form
[
'
recordName
'
]
recordAddress
=
request
.
form
[
'
recordAddress
'
]
recordMainPhotos
=
request
.
form
[
'
recordMainPhotos
'
]
recordAdditionalPhotos
=
request
.
form
[
'
recordAdditionalPhotos
'
]
recordDescription
=
request
.
form
[
'
recordDescription
'
]
recordWebsite
=
request
.
form
[
'
recordWebsite
'
]
recordEmail
=
request
.
form
[
'
recordEmail
'
]
recordPhoneNumber
=
request
.
form
[
'
recordPhoneNumber
'
]
recordOpeningHours
=
request
.
form
[
'
recordOpeningHours
'
]
recordCheckinInstructions
=
request
.
form
[
'
recordCheckinInstructions
'
]
recordData
=
[
recordName
,
recordAddress
,
recordMainPhotos
,
recordAdditionalPhotos
,
recordDescription
,
recordWebsite
,
recordEmail
,
recordPhoneNumber
,
recordOpeningHours
,
recordCheckinInstructions
]
return
recordData
def
addCoworkingSpaces
(
data
):
def
addCoworkingSpaces
(
data
):
with
open
(
'
coworking_spaces.csv
'
,
'
a
'
)
as
addToFile
:
with
open
(
'
coworking_spaces.csv
'
,
'
a
'
)
as
addToFile
:
...
...
This diff is collapsed.
Click to expand it.
static/__pycache__/coworking_functions.cpython-310.pyc
+
0
−
0
View file @
71df99e9
No preview for this file type
This diff is collapsed.
Click to expand it.
tempServer.py
+
7
−
16
View file @
71df99e9
...
@@ -8,27 +8,18 @@ ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
...
@@ -8,27 +8,18 @@ ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
@app.route
(
"
/AddRecord
"
,
methods
=
[
'
POST
'
])
@app.route
(
"
/AddRecord
"
,
methods
=
[
'
POST
'
])
def
addRecord
():
def
addRecord
():
print
(
'
Processing record.
'
)
infoMessage
=
'
Add record failed.
'
if
(
request
.
method
==
'
POST
'
):
recordName
=
request
.
form
[
'
recordName
'
]
recordAddress
=
request
.
form
[
'
recordAddress
'
]
recordMainPhotos
=
request
.
form
[
'
recordMainPhotos
'
]
recordAdditionalPhotos
=
request
.
form
[
'
recordAdditionalPhotos
'
]
recordDescription
=
request
.
form
[
'
recordDescription
'
]
recordWebsite
=
request
.
form
[
'
recordWebsite
'
]
recordEmail
=
request
.
form
[
'
recordEmail
'
]
recordPhoneNumber
=
request
.
form
[
'
recordPhoneNumber
'
]
recordOpeningHours
=
request
.
form
[
'
recordOpeningHours
'
]
recordCheckinInstructions
=
request
.
form
[
'
recordCheckinInstructions
'
]
recordData
=
[
recordName
,
recordAddress
,
recordMainPhotos
,
recordAdditionalPhotos
,
recordDescription
,
recordWebsite
,
recordEmail
,
recordPhoneNumber
,
recordOpeningHours
,
recordCheckinInstructions
]
print
(
'
Processing record.
'
)
infoMessage
=
(
'
Add record failed.
'
)
if
(
request
.
method
==
'
POST
'
):
recordData
=
Coworking_Functions
.
getCoworkingSpaces
()
Coworking_Functions
.
addCoworkingSpaces
(
recordData
)
Coworking_Functions
.
addCoworkingSpaces
(
recordData
)
infoMessage
=
(
f
'
{
recordData
}
Record added.
'
)
print
(
infoMessage
)
print
(
infoMessage
)
return
infoMessage
return
(
infoMessage
)
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
app
.
run
(
debug
=
True
)
app
.
run
(
debug
=
True
)
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