CognitiveScience commited on
Commit
6b08a33
1 Parent(s): dfabac8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -52,14 +52,14 @@ except sqlite3.OperationalError:
52
  def get_latest_reviews(db: sqlite3.Connection):
53
  reviews = db.execute("SELECT * FROM reviews ORDER BY id DESC limit 100").fetchall()
54
  total_reviews = db.execute("Select COUNT(id) from reviews").fetchone()[0]
55
- reviews = pd.DataFrame(reviews, columns=["id", "date_created", "name", "rate", "celsci"])
56
  return reviews, total_reviews
57
 
58
 
59
  def ccogsphere(name: str, rate: int, celsci: str):
60
  db = sqlite3.connect(DB_FILE)
61
  cursor = db.cursor()
62
- cursor.execute("INSERT INTO reviews(name, rate, celsci) VALUES(?,?,?)", [name, rate, celsci])
63
  db.commit()
64
  reviews, total_reviews = get_latest_reviews(db)
65
  db.close()
 
52
  def get_latest_reviews(db: sqlite3.Connection):
53
  reviews = db.execute("SELECT * FROM reviews ORDER BY id DESC limit 100").fetchall()
54
  total_reviews = db.execute("Select COUNT(id) from reviews").fetchone()[0]
55
+ reviews = pd.DataFrame(reviews, columns=["id", "date_created", "name", "rate", "celsci_Result"])
56
  return reviews, total_reviews
57
 
58
 
59
  def ccogsphere(name: str, rate: int, celsci: str):
60
  db = sqlite3.connect(DB_FILE)
61
  cursor = db.cursor()
62
+ cursor.execute("INSERT INTO reviews(name, rate, celsci_Result) VALUES(?,?,?)", [name, rate, celsci])
63
  db.commit()
64
  reviews, total_reviews = get_latest_reviews(db)
65
  db.close()