commit message from python script
This commit is contained in:
@@ -9,8 +9,8 @@ class db_work:
|
||||
cursor = con_db.cursor()
|
||||
sql_code = """
|
||||
CREATE TABLE IF NOT EXISTS movies(
|
||||
'id' INTEGER AUTOINCREMENT,
|
||||
'name' TEXT PRIMARY KEY,
|
||||
'id' INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
'name' TEXT,
|
||||
'filmgenres' TEXT,
|
||||
'year' TEXT,
|
||||
'persönlich' TEXT
|
||||
@@ -40,13 +40,22 @@ class db_work:
|
||||
cursor.execute(sql)
|
||||
if not cursor.fetchone():
|
||||
print("Film wird angelgt ")
|
||||
#self.speicher_aktion(name, ort, vorfall)
|
||||
self.speicher_aktion(movie=name, filmgenre=movie_genre, year=movie_year, persönlich=per_info)
|
||||
else:
|
||||
print("Film bereits vorhanden !")
|
||||
print("Eingabevorgang wurde beendet.")
|
||||
|
||||
def speicher_aktion():
|
||||
pass
|
||||
def speicher_aktion(self, movie = str, filmgenre = str, year = str, persönlich = str):
|
||||
with sqlite3.connect(self.db_file) as verbindung:
|
||||
cursor = verbindung.cursor()
|
||||
sql = """INSERT INTO movies(name, filmgenres, year, 'persönlich' )
|
||||
VALUES ( '{movie}', '{filmgenre}', '{year}', '{persönlich}' );""".format(
|
||||
movie=movie,
|
||||
filmgenre=filmgenre,
|
||||
year=year,
|
||||
persönlich=persönlich)
|
||||
|
||||
cursor.execute(sql)
|
||||
|
||||
def show_value(self, sql_query = str):
|
||||
with sqlite3.connect(self.db_file) as con_db:
|
||||
|
||||
Reference in New Issue
Block a user