database elsa changes
This commit is contained in:
@@ -1301,10 +1301,24 @@ class Database:
|
||||
semester (str): the semester the apparat is created in
|
||||
"""
|
||||
self.query_db(
|
||||
"INSERT INTO elsa (date, prof_id, semester) VALUES (?,?,?)",
|
||||
"INSERT OR IGNORE INTO elsa (date, prof_id, semester) VALUES (?,?,?)",
|
||||
(date, prof_id, semester),
|
||||
)
|
||||
|
||||
def updateElsaApparat(self, date, prof_id, semester, elsa_id):
|
||||
"""update an ELSA apparat in the database
|
||||
|
||||
Args:
|
||||
date (str): the name of the apparat
|
||||
prof_id (int): the id of the professor
|
||||
semester (str): the semester the apparat is created in
|
||||
elsa_id (int): the id of the ELSA apparat
|
||||
"""
|
||||
self.query_db(
|
||||
"UPDATE elsa SET date=?, prof_id=?, semester=? WHERE id=?",
|
||||
(date, prof_id, semester, elsa_id),
|
||||
)
|
||||
|
||||
def addElsaMedia(self, data: dict, elsa_id: int):
|
||||
"""add a media to the ELSA system
|
||||
|
||||
@@ -1313,8 +1327,16 @@ class Database:
|
||||
Structured: {"chapter":str, "title":str, "signature":str, "pages":str}
|
||||
"""
|
||||
self.query_db(
|
||||
"INSERT INTO elsa_media (chapter, title, signature, pages, elsa_id) VALUES (?,?,?,?,?)",
|
||||
(data["chapter"], data["title"], data["signature"], data["pages"], elsa_id),
|
||||
"INSERT INTO elsa_media (chapter, title, signature, pages,book_author,text_author, elsa_id) VALUES (?,?,?,?,?,?,?)",
|
||||
(
|
||||
data["chapter"],
|
||||
data["title"],
|
||||
data["signature"],
|
||||
data["pages"],
|
||||
data["book_author"],
|
||||
data["text_author"],
|
||||
elsa_id,
|
||||
),
|
||||
)
|
||||
|
||||
def getElsaMedia(self, elsa_id: int):
|
||||
|
||||
Reference in New Issue
Block a user