clone3 commited on
Commit
07622e3
·
1 Parent(s): 13bf9bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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(url):
13
- books = table.search(tinydb.where("url") == url)
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(url)
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":