aboutsummaryrefslogtreecommitdiffstats
path: root/database.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2022-02-06 16:55:00 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2022-02-06 16:55:00 +0000
commite8285e533c8ed7ff3e68f72b0bbac04b478f19c9 (patch)
treec4ee6e12a1f543ed03e42516d1dc3497c0fc230d /database.py
parent6f3bca8d3aafe67a5b30a456ab5e80319930e1b6 (diff)
downloadboymoder.blog-e8285e533c8ed7ff3e68f72b0bbac04b478f19c9.tar.gz
boymoder.blog-e8285e533c8ed7ff3e68f72b0bbac04b478f19c9.zip
added linux ISO CD form
Diffstat (limited to 'database.py')
-rw-r--r--database.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/database.py b/database.py
index bb870b8..3dd2d9a 100644
--- a/database.py
+++ b/database.py
@@ -183,6 +183,21 @@ class Database:
cursor.execute("SELECT link FROM headerLinks WHERE name = 'twitter';")
return cursor.fetchone()[0]
+ def get_iso_cd_options(self):
+ with self.__connection.cursor() as cursor:
+ cursor.execute("SELECT name FROM isocds;")
+ return [i[0] for i in cursor.fetchall()]
+
+ def append_cd_orders(self, iso, email, house, street, city, county, postcode, name):
+ with self.__connection.cursor() as cursor:
+ cursor.execute("""
+ INSERT INTO cd_orders (cd_id, email, house, street, city, county, postcode, name)
+ VALUES ((SELECT cd_id FROM isocds WHERE name = %s), %s, %s, %s, %s, %s, %s, %s);
+ """, (iso, email, house, street, city, county, postcode, name))
+ id_ = cursor.lastrowid
+ self.__connection.commit()
+ return id_
+
def update_cache():
# print("updating cache...")
with Database() as db:
@@ -233,4 +248,5 @@ def request_recent_commits(since = datetime.datetime.now() - datetime.timedelta(
if __name__ == "__main__":
with Database() as db:
- print(db.get_similar_thoughts("about me", 5)) \ No newline at end of file
+ # print(db.get_similar_thoughts("about me", 5))
+ print(db.get_iso_cd_options()) \ No newline at end of file