Browse Source

added database to folder

Bernadette Elena Hammerle 1 year ago
parent
commit
37399b95dd
6 changed files with 38 additions and 3 deletions
  1. 2 2
      app.py
  2. 14 0
      database/db_contribute.json
  3. 0 0
      database/db_map.json
  4. 0 0
      database/db_steps.json
  5. 22 0
      database/db_welcome.json
  6. 0 1
      database_contribute.json

+ 2 - 2
app.py

@@ -63,7 +63,7 @@ def contribute():
 
 
 def read_database(db_name):
-    with open(f"{FOLDER}database_{db_name}.json") as file:
+    with open(f"{FOLDER}database/db_{db_name}.json") as file:
         db_data = json.load(file)
     return db_data
 
@@ -71,7 +71,7 @@ def read_database(db_name):
 def add_to_database(db_name, data_to_add):
     db_data = read_database(db_name)
     db_data.append(data_to_add)
-    with open(f"{FOLDER}database_{db_name}.json", "w") as file:
+    with open(f"{FOLDER}database/db_{db_name}.json", "w") as file:
         json.dump(db_data, file, indent=4)
 
 

+ 14 - 0
database/db_contribute.json

@@ -0,0 +1,14 @@
+[
+    {
+        "fullname": "1",
+        "email": "2@2",
+        "message": "23",
+        "timestamp": 1682365205.378369
+    },
+    {
+        "fullname": "132",
+        "email": "1@asd",
+        "message": "1231",
+        "timestamp": 1682365212.381221
+    }
+]

+ 0 - 0
database_map.json → database/db_map.json


+ 0 - 0
database_steps.json → database/db_steps.json


+ 22 - 0
database/db_welcome.json

@@ -0,0 +1,22 @@
+[
+ {
+  "title": "Was?",
+  "subtitle": "Klimafreundlich und bequem",
+  "text": "Nach & Nach ist ein Projekt, das Menschen helfen soll ihr Leben nach und nach klimafreundlicher zu gestalten, indem es kleine nachhaltige Schritte und Initiativen in der Nachbarschaft aufzeigt."
+ },
+ {
+  "title": "Wann?",
+  "subtitle": "Ideenwerkstatt",
+  "text": "Das Projekt ist im Rahmen von UpdateSocial im April 2023 entstanden.",
+  "url": "https://updatesocial.org/"
+ },
+ {
+  "title": "Wer?",
+  "subtitle": "Unser Team",
+  "text": "Fünf motivierte UpdateSocial-Teilnehmer*innen mit Unterstützung von zahlreichen Experten*innen."
+ },
+ {
+  "title": "Warum?",
+  "text": "Weil wir etwas verändern wollen."
+ }
+]

+ 0 - 1
database_contribute.json

@@ -1 +0,0 @@
-[]