Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,8 @@ def Insert(url, users):
|
|
9 |
table.insert(book)
|
10 |
return f"Added {url} by {users} to the database."
|
11 |
|
12 |
-
def Fetch(
|
13 |
-
books = table.search(tinydb.where("
|
14 |
books_str = "\n".join([f"{book['url']} by {book['users']}" for book in books])
|
15 |
return books_str
|
16 |
|
@@ -27,7 +27,7 @@ def process_data(option, url, users):
|
|
27 |
if option == "Insert":
|
28 |
return Insert(url, users)
|
29 |
elif option == "Fetch":
|
30 |
-
return Fetch(
|
31 |
elif option == "Update":
|
32 |
return Update(url, users)
|
33 |
elif option == "Delete":
|
|
|
9 |
table.insert(book)
|
10 |
return f"Added {url} by {users} to the database."
|
11 |
|
12 |
+
def Fetch(users):
|
13 |
+
books = table.search(tinydb.where("users") == users)
|
14 |
books_str = "\n".join([f"{book['url']} by {book['users']}" for book in books])
|
15 |
return books_str
|
16 |
|
|
|
27 |
if option == "Insert":
|
28 |
return Insert(url, users)
|
29 |
elif option == "Fetch":
|
30 |
+
return Fetch(users)
|
31 |
elif option == "Update":
|
32 |
return Update(url, users)
|
33 |
elif option == "Delete":
|