From b08bcf5eb41b3d7959e6c7936fa75f9c70f523b9 Mon Sep 17 00:00:00 2001 From: Liam Driscoll <driscolll4@cardiff.ac.uk> Date: Thu, 24 Nov 2022 17:38:14 +0000 Subject: [PATCH 1/3] Adding files related to adding a coworking space. --- static/add_coworking_spaces.py | 25 +++++++++++++++++++++++++ static/coworking_spaces.csv | 6 ++++++ static/coworking_spaces.db | Bin 0 -> 8192 bytes static/test | 20 ++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 static/add_coworking_spaces.py create mode 100644 static/coworking_spaces.csv create mode 100644 static/coworking_spaces.db create mode 100644 static/test diff --git a/static/add_coworking_spaces.py b/static/add_coworking_spaces.py new file mode 100644 index 0000000..9fcc1b7 --- /dev/null +++ b/static/add_coworking_spaces.py @@ -0,0 +1,25 @@ +import flask +import csv + +name_Value = "NEWNEWNEW" +address_Value = "123CodeBase Edinburgh , 37a Castle Terrace, Edinburgh, EH1 2EL" +MP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" +AP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868533510-J1OT4PEG5VM9FCBF8BJE/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-19+%281%29.jpg?format=2500w,https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868421127-07KQ4N1OHTDDKQME686A/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-52+%281%29.jpg?format=2500w" +description_Value = "123Hi. We\u2019re CodeBase. We've been exploring the world of startups and innovation for over five years now. We're not really sure how to best describe what we do, but we think the words \"tech cluster\" probably do it best. Please get in touch! We\u2019re friendly people who are geeky about building tech startups, managing disruption and innovation." +website_Value = "123https://www.thisiscodebase.com" +email_Value = "123info@thisiscodebase.com" +PN_Value = "123Hi(+44) 0131 560 2003" +OH_Value = "12308:00 - 17:00" +CI_Value = "123Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" + +recordValues = [name_Value, address_Value, MP_Value, AP_Value, description_Value, website_Value, email_Value, PN_Value, OH_Value, CI_Value] + +def addWorkingSpaces(values): + + with open('coworking_spaces.csv', 'a') as addToFile: + csvWriter = csv.writer(addToFile) + csvWriter.writerow(values) + addToFile.close() + return (f"{values} added.") + +addWorkingSpaces(recordValues) diff --git a/static/coworking_spaces.csv b/static/coworking_spaces.csv new file mode 100644 index 0000000..d2b3226 --- /dev/null +++ b/static/coworking_spaces.csv @@ -0,0 +1,6 @@ +Name,Address,Main_Photo,Additional_Photos,Description,Website,Email,Phone_Number,Opening_Hours,Checkin_Instructions +Codebase,"CodeBase Edinburgh , 37a Castle Terrace, Edinburgh, EH1 2EL",https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w,"https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868533510-J1OT4PEG5VM9FCBF8BJE/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-19+%281%29.jpg?format=2500w,https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868421127-07KQ4N1OHTDDKQME686A/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-52+%281%29.jpg?format=2500w","Hi. We’re CodeBase. We've been exploring the world of startups and innovation for over five years now. We're not really sure how to best describe what we do, but we think the words ""tech cluster"" probably do it best. Please get in touch! We’re friendly people who are geeky about building tech startups, managing disruption and innovation.",https://www.thisiscodebase.com,info@thisiscodebase.com,(+44) 0131 560 2003,08:00 - 17:00,"Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" +Catalyst,"Titanic Quarter, Queens Road, Belfast, BT3 9DT",https://wearecatalyst.org/wp-content/uploads/2022/05/Catalyst03.jpg,"https://wearecatalyst.org/wp-content/uploads/2022/03/DSC07673-scaled-2048x1570.jpg,https://wearecatalyst.org/wp-content/uploads/2021/01/2F6A1513.jpg","We are an independent, not-for-profit organisation working together for the greater good, enabling a connected community of like-minded innovators in an entrepreneurial eco-system that is the key driver of the knowledge economy in Northern Ireland.",https://wearecatalyst.org,enquiries@wearecatalyst.org,+44(0)28 9073 7800,08:00 - 18:00,"Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" +C4DI,"C4DI Campus, 31-38 Queen Street, Hull, HU1 1UU",https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1594914119071-OWI9G22S295OCMSWL0VL/_K5L1162.jpg?format=2500w,"https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1588346951023-V0QWKQI35IDUACMOJ0WM/_MKL2718.jpg?format=750w,https://images.squarespace-cdn.com/content/v1/5709040420c647579532dbb4/1588346977833-LGY6P9473H2C5JF6I2UG/_K5M5505.jpg?format=750w","C4DI is an incubator that helps tech companies grow, and traditional businesses innovate.",http://www.c4di.co.uk,lc@c4di.net,+44 1482 304244,9am - 5pm,"Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" +Dogpatch Labs,"Custom House Quay, Dublin, D01 Y6H7",https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2022/09/ian_browne.jpg,"https://dogpatchlabs.wpenginepowered.com/wp-content/uploads/2021/07/bordered.jpg,https://dogpatchlabs.com/wp-content/uploads/2020/03/UG_3-1.jpg","Dogpatch Labs is a startup hub, located in the heart of Dublin’s Digital Docklands.",https://dogpatchlabs.com,info@dogpatchlabs.com,,8:30 - 5:30,"Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" +Stafion F,"5 Parvis Alan Turing, Paris",https://stationf.co/img/misc/create-zone.jpg,",https://stationf.co/img/flatmates/coffee-restaurant.jpg","Based in central Paris, STATION F gathers a whole entrepreneurial ecosystem under one roof. We help entrepreneurs bring their ambitious ideas to life.",https://stationf.co,,,0:00 - 0:00,Book through the Tramshed Tech app diff --git a/static/coworking_spaces.db b/static/coworking_spaces.db new file mode 100644 index 0000000000000000000000000000000000000000..73b2146c58484292d12e86ed6c341bb8f9a265ac GIT binary patch literal 8192 zcmeIuJqp5548ZZc;wtt6g^aqmcmS=^t&7?VRD8-q`@!Qay_bjaI9jmKt-JgKAt4DF ze&=KEg4J8&t1{?DVlhT`sv;7N(){|_w+_+IrXrH{_C4>fVv)sb>YP0S2q1s}0tg_0 z00IagfB*srj0Ex|F)oysr>&b{t2T5)jSi<QEix_AeV*ws)up?ttAo8;udR1g={tSc dZZ-NzivR)$Ab<b@2q1s}0tg_000Mt1@BwpnA*BES literal 0 HcmV?d00001 diff --git a/static/test b/static/test new file mode 100644 index 0000000..7286449 --- /dev/null +++ b/static/test @@ -0,0 +1,20 @@ +def getFieldnames(csvFile): + + fieldnames = [] + with open(csvFile, 'r') as readFile: + csvReader = csv.reader(readFile) + fieldnames = next(csvReader) + readFile.close() + return fieldnames + +dictKeys = getFieldnames('coworking_spaces.csv') + +""" +""" + +newRecord = {} +for x in range(len(keys)): + newRecord[keys[x]] = values[x] + +""" +""" -- GitLab From 3cc68dc8045e2558c8ef7b33a60d0f1600fd0ba6 Mon Sep 17 00:00:00 2001 From: Liam Driscoll <driscolll4@cardiff.ac.uk> Date: Thu, 24 Nov 2022 18:03:21 +0000 Subject: [PATCH 2/3] Reshuffling work. --- static/add_coworking_spaces.py | 25 ------------------------- static/coworking_spaces.db | Bin 8192 -> 0 bytes static/coworking_spaces_functions.py | 9 +++++++++ static/test | 13 +++++++++++++ 4 files changed, 22 insertions(+), 25 deletions(-) delete mode 100644 static/add_coworking_spaces.py delete mode 100644 static/coworking_spaces.db create mode 100644 static/coworking_spaces_functions.py diff --git a/static/add_coworking_spaces.py b/static/add_coworking_spaces.py deleted file mode 100644 index 9fcc1b7..0000000 --- a/static/add_coworking_spaces.py +++ /dev/null @@ -1,25 +0,0 @@ -import flask -import csv - -name_Value = "NEWNEWNEW" -address_Value = "123CodeBase Edinburgh , 37a Castle Terrace, Edinburgh, EH1 2EL" -MP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" -AP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868533510-J1OT4PEG5VM9FCBF8BJE/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-19+%281%29.jpg?format=2500w,https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868421127-07KQ4N1OHTDDKQME686A/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-52+%281%29.jpg?format=2500w" -description_Value = "123Hi. We\u2019re CodeBase. We've been exploring the world of startups and innovation for over five years now. We're not really sure how to best describe what we do, but we think the words \"tech cluster\" probably do it best. Please get in touch! We\u2019re friendly people who are geeky about building tech startups, managing disruption and innovation." -website_Value = "123https://www.thisiscodebase.com" -email_Value = "123info@thisiscodebase.com" -PN_Value = "123Hi(+44) 0131 560 2003" -OH_Value = "12308:00 - 17:00" -CI_Value = "123Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" - -recordValues = [name_Value, address_Value, MP_Value, AP_Value, description_Value, website_Value, email_Value, PN_Value, OH_Value, CI_Value] - -def addWorkingSpaces(values): - - with open('coworking_spaces.csv', 'a') as addToFile: - csvWriter = csv.writer(addToFile) - csvWriter.writerow(values) - addToFile.close() - return (f"{values} added.") - -addWorkingSpaces(recordValues) diff --git a/static/coworking_spaces.db b/static/coworking_spaces.db deleted file mode 100644 index 73b2146c58484292d12e86ed6c341bb8f9a265ac..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8192 zcmeIuJqp5548ZZc;wtt6g^aqmcmS=^t&7?VRD8-q`@!Qay_bjaI9jmKt-JgKAt4DF ze&=KEg4J8&t1{?DVlhT`sv;7N(){|_w+_+IrXrH{_C4>fVv)sb>YP0S2q1s}0tg_0 z00IagfB*srj0Ex|F)oysr>&b{t2T5)jSi<QEix_AeV*ws)up?ttAo8;udR1g={tSc dZZ-NzivR)$Ab<b@2q1s}0tg_000Mt1@BwpnA*BES diff --git a/static/coworking_spaces_functions.py b/static/coworking_spaces_functions.py new file mode 100644 index 0000000..362635f --- /dev/null +++ b/static/coworking_spaces_functions.py @@ -0,0 +1,9 @@ +from csv import writer + +def addWorkingSpaces(values): + + with open('coworking_spaces.csv', 'a') as addToFile: + csvWriter = writer(addToFile) + csvWriter.writerow(values) + addToFile.close() + return (f"{values} added.") diff --git a/static/test b/static/test index 7286449..d9135c2 100644 --- a/static/test +++ b/static/test @@ -18,3 +18,16 @@ for x in range(len(keys)): """ """ + +name_Value = "NEWNEWNEW" +address_Value = "123CodeBase Edinburgh , 37a Castle Terrace, Edinburgh, EH1 2EL" +MP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646867535415-4JI39H286BUMT26H4FHN/C36A1915.jpg?format=2500w" +AP_Value = "123https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868533510-J1OT4PEG5VM9FCBF8BJE/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-19+%281%29.jpg?format=2500w,https://images.squarespace-cdn.com/content/v1/55439320e4b0f92b5d6c4c8b/1646868421127-07KQ4N1OHTDDKQME686A/15.10.19_-_CREATIVE_BRIDGE_C02_-_DAY01_-_LQ-52+%281%29.jpg?format=2500w" +description_Value = "123Hi. We\u2019re CodeBase. We've been exploring the world of startups and innovation for over five years now. We're not really sure how to best describe what we do, but we think the words \"tech cluster\" probably do it best. Please get in touch! We\u2019re friendly people who are geeky about building tech startups, managing disruption and innovation." +website_Value = "123https://www.thisiscodebase.com" +email_Value = "123info@thisiscodebase.com" +PN_Value = "123Hi(+44) 0131 560 2003" +OH_Value = "12308:00 - 17:00" +CI_Value = "123Use the email address or phone number to call ahead and book a desk, let them know you're a Tramshed member" + +recordValues = [name_Value, address_Value, MP_Value, AP_Value, description_Value, website_Value, email_Value, PN_Value, OH_Value, CI_Value] -- GitLab From fa10521c5b156bdc558059b0293993b5d42a1afb Mon Sep 17 00:00:00 2001 From: Liam Driscoll <driscolll4@cardiff.ac.uk> Date: Thu, 24 Nov 2022 22:34:16 +0000 Subject: [PATCH 3/3] Adding temporary server to test add record functions. --- __init__.py | 0 ...working_spaces.csv => coworking_spaces.csv | 0 ...es_functions.py => Coworking_Functions.py} | 6 +- static/Manage_Coworking_Spaces.html | 55 ++++++++++++++++++ static/Manage_Coworking_Spaces.js | 38 ++++++++++++ static/__init__.py | 0 static/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 200 bytes .../coworking_functions.cpython-310.pyc | Bin 0 -> 530 bytes ...coworking_spaces_functions.cpython-310.pyc | Bin 0 -> 535 bytes tempServer.py | 34 +++++++++++ 10 files changed, 130 insertions(+), 3 deletions(-) create mode 100644 __init__.py rename static/coworking_spaces.csv => coworking_spaces.csv (100%) rename static/{coworking_spaces_functions.py => Coworking_Functions.py} (59%) create mode 100644 static/Manage_Coworking_Spaces.html create mode 100644 static/Manage_Coworking_Spaces.js create mode 100644 static/__init__.py create mode 100644 static/__pycache__/__init__.cpython-310.pyc create mode 100644 static/__pycache__/coworking_functions.cpython-310.pyc create mode 100644 static/__pycache__/coworking_spaces_functions.cpython-310.pyc create mode 100644 tempServer.py diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/static/coworking_spaces.csv b/coworking_spaces.csv similarity index 100% rename from static/coworking_spaces.csv rename to coworking_spaces.csv diff --git a/static/coworking_spaces_functions.py b/static/Coworking_Functions.py similarity index 59% rename from static/coworking_spaces_functions.py rename to static/Coworking_Functions.py index 362635f..a5c9134 100644 --- a/static/coworking_spaces_functions.py +++ b/static/Coworking_Functions.py @@ -1,9 +1,9 @@ from csv import writer -def addWorkingSpaces(values): +def addCoworkingSpaces(data): with open('coworking_spaces.csv', 'a') as addToFile: csvWriter = writer(addToFile) - csvWriter.writerow(values) + csvWriter.writerow(data) addToFile.close() - return (f"{values} added.") + return (f"{data} added.") diff --git a/static/Manage_Coworking_Spaces.html b/static/Manage_Coworking_Spaces.html new file mode 100644 index 0000000..7f11000 --- /dev/null +++ b/static/Manage_Coworking_Spaces.html @@ -0,0 +1,55 @@ +<!DOCTYPE html> +<html lang="EN" dir="ltr"> + <head> + <meta charSet="UTF-8"> + <title> Page Template </title> + <link rel="stylesheet" href="StylingSheet.css"> + + </head> + <body onLoad="pageLoad()"> + + <header id="header"> + <a href=""><h1>Page Header</h1></a> + </header> + + <hr> + + <main id="recordSection"> + <form id="recordForm" title="Record Form"> + <label>Name: <input name="record_name" id="recordName" + type="text"></label><br> + <label>Address: <input name="record_address" id="recordAddress" + type="text"></label><br> + <label>Main Photograph: <input name="record_MP" id="recordMainPhotos" + type="text"></label><br> + <label>Additional Photographs: <input name="record_AP" id="recordAdditionalPhotos" + type="text"></label><br> + <label>Description: <input name="record_description" id="recordDescription" + type="text"></label><br> + <label>Website: <input name="record_website" id="recordWebsite" + type="text"></label><br> + <label>Email: <input name="record_email" id="recordEmail" + type="text"></label><br> + <label>Phone Number: <input name="record_PN" id="recordPhoneNumber" + type="text"></label><br> + <label>Opening Hours: <input name="record_OH" id="recordOpeningHours" + type="text"></label><br> + <label>Checkin Instructions: <input name="record_CI" id="recordCheckinInstructions" + type="text"></label> + + <br><br> + <button id="addButton" type="submit">Add</button> + </form> + <br> + <span id="DEBUGserverMessage"> </span> + </main> + + <hr> + + <footer id="footer"> + <a href="#header">Top</a> + </footer> + + <script src="Manage_Coworking_Spaces.js"></script> + </body> +</html> diff --git a/static/Manage_Coworking_Spaces.js b/static/Manage_Coworking_Spaces.js new file mode 100644 index 0000000..2cd7b3f --- /dev/null +++ b/static/Manage_Coworking_Spaces.js @@ -0,0 +1,38 @@ +// Replaces the onSubmit attribute for the addRecord form. +function pageLoad() { + document.getElementById('addButton').addEventListener('click',addRecord); +} + +// Adds a record to the CSV file. +function addRecord(e) { + // Removes the standard form processing. + e.preventDefault(); + e.stopPropagation(); + + var recordName = document.getElementById("recordName").value; + var recordAddress = document.getElementById("recordAddress").value; + var recordMainPhotos = document.getElementById("recordMainPhotos").value; + var recordAdditionalPhotos = document.getElementById("recordAdditionalPhotos").value; + var recordDescription = document.getElementById("recordDescription").value; + var recordWebsite = document.getElementById("recordWebsite").value; + var recordEmail = document.getElementById("recordEmail").value; + var recordPhoneNumber = document.getElementById("recordPhoneNumber").value; + var recordOpeningHours = document.getElementById("recordOpeningHours").value; + var recordCheckinInstructions = document.getElementById("recordCheckinInstructions").value; + + var params = 'recordName='+recordName+'&recordAddress='+recordAddress+'&recordMainPhotos='+recordMainPhotos+'&recordAdditionalPhotos='+recordAdditionalPhotos+'&recordDescription='+recordDescription+'&recordWebsite='+recordWebsite+'&recordEmail='+recordEmail+'&recordPhoneNumber='+recordPhoneNumber+'&recordOpeningHours='+recordOpeningHours+'&recordCheckinInstructions='+recordCheckinInstructions; + + var xhttp = new XMLHttpRequest(); + xhttp.open("POST", '/AddRecord', true); + xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); + xhttp.onreadystatechange = function() { + if (xhttp.readyState === 4 && xhttp.status === 200) { + console.log(xhttp.responseText); + document.getElementById("DEBUGserverMessage").innerHTML = xhttp.responseText; + } else { + console.error(`Status Text: ${xhttp.statusText}.`); + console.error(`Ready State: ${xhttp.readyState}.`); + } + }; + xhttp.send(params); +} diff --git a/static/__init__.py b/static/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/static/__pycache__/__init__.cpython-310.pyc b/static/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e099c12ae40d9f36336371daeaa85bcd52de30f GIT binary patch literal 200 zcmd1j<>g`k0t>ImWDxxrL?8o3AjbiSi&=m~3PUi1CZpd<h9ZzKg7}r~WEB&foROcO z6XTp%l#-d2rVyH!S(aK<oLN#C6PcP=q+l46oRgWFSE5@`l%JKFTv8lUQk0lmoRONM zTaucbp^GXD6idw2H8hPWE=erOOpb|<&&<m#iI3MSsJz8tlbfGXnv-e=azrr`kYHf| E03Y@={{R30 literal 0 HcmV?d00001 diff --git a/static/__pycache__/coworking_functions.cpython-310.pyc b/static/__pycache__/coworking_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..686c5e64725d8003e480164cad09f9b2c489d099 GIT binary patch literal 530 zcmY*WKTiTN6mNTn90V5QV4R3?xd9Re7h{Z(#F0TXgv%wSX^T{kD`^V^0&&3I4`57S z^s_j--0I|4FbuvsHR5}D@8$jJukY8Ya=C~=Uf=H78sdAJYzl$o6wK^`<A~!3^>KhP z;)FX7C?MQzAwTy4UF73rYpkUen&CA65eK3N)&MgX;4Hv!vLKIpb8PVpFYuhq$db&^ z3V>&L>8ub$^n|$cOxlRR#V+W=!Kj7m$n1|{F4Ybghnnv;r#noImA;el&9xa&CQOZ) zQG)3-U!j}}Ui00=RRa<0lvCh+Z>q*gjz!7{-$`6fEe#4VeW}i6B!U7Uv@=34Nax|y z=jiMxY_XnFQP`lG%Wk)F70Z#(M%qc(5mZ;|A&aDlZFQj4tzg!KR@1)e30}2=^{W57 zP^0~7{V+6^TFJsc65V0UtW>e74JOGpEY<ks*UIRn&uU8GO2orO?13JvbpZ-Z-w7O8 dJtLY`vgJ2i`W=aP+*f=UiIeoRjGH0>))&E$g%|(; literal 0 HcmV?d00001 diff --git a/static/__pycache__/coworking_spaces_functions.cpython-310.pyc b/static/__pycache__/coworking_spaces_functions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..97f919c253eb91632b309dafbbf07caa64c515c3 GIT binary patch literal 535 zcmZ8ePfG$p6rY)0a}|XS9io#&mpv$W=n@f8(9uH{;<6ya%$QT_j?9dTqI9r(A0Prf z_GS72d+pR$kb>T>9jy0w@A3Z3Z{BZ4mCHp0^8NnE)(}6^WLpR%=U`?Z97h~SsE-4T z5hvVvLIL4!6ZyGM=pr8{J7X=a&<v;fuQ(7ruuCv=4bB1#Ckyg?Fvk|p@B+`tj4a6v ztpIq2m(B`7L@$UtucU<tT<n4_9E_T%j?Cd0=2C5gaj5xjW4g!GSm_5D-*wD@GGS`W zj1o+z`3mJ+@S5)?t{R9~r<?+Bv#A;<ITk4+d?#@^wKOQe^o_cbkq8Qa(8>tCA)SX) z>-oh=*knDWqVSSxF1y{zZ7fGZ8)+wDTTor8hb)pJw$*`F_kvjyT21?=CwSEg)~o*Q zLXGyT_2bZ3Y9$N*ljwAZF|$&|rZ$))yRchpL$aB1OyAa&z?F!Hi`WA_`qBj`G<+v; eVE>G5R>>G_x%5vG@3gP@FcN3!j~O>b0<0f1HHT6F literal 0 HcmV?d00001 diff --git a/tempServer.py b/tempServer.py new file mode 100644 index 0000000..bd1f86d --- /dev/null +++ b/tempServer.py @@ -0,0 +1,34 @@ +import os +from flask import Flask, redirect, request, render_template, jsonify +from static import Coworking_Functions + +app = Flask(__name__) + +ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) + +@app.route("/AddRecord", methods=['POST']) +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] + + Coworking_Functions.addCoworkingSpaces(recordData) + + print(infoMessage) + return infoMessage + +if __name__ == "__main__": + app.run(debug=True) -- GitLab