train
This commit is contained in:
parent
ff2e91f7be
commit
027e4aceed
4 changed files with 12 additions and 9 deletions
0
baseFilm.db
Normal file
0
baseFilm.db
Normal file
BIN
baseFilms (kopio 1).db
Normal file
BIN
baseFilms (kopio 1).db
Normal file
Binary file not shown.
|
@ -24,21 +24,22 @@ class filmSQ():
|
||||||
def __init__(self, dic):
|
def __init__(self, dic):
|
||||||
"""ceci est une aide"""
|
"""ceci est une aide"""
|
||||||
|
|
||||||
self.idN = dic['idN']
|
|
||||||
|
|
||||||
conn = sqlite3.connect("baseFilms.db")
|
conn = sqlite3.connect("baseFilms.db")
|
||||||
conn.row_factory = sqlite3.Row
|
conn.row_factory = sqlite3.Row
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
|
|
||||||
|
try:
|
||||||
c.execute('INSERT INTO films VALUES (:i, :idN, :date, :nom, :realisateur, :duree, :synopsis, :pays, :annee, :youtube, :couleur, :image, :formatCopie, :langST)', dic)
|
c.execute('INSERT INTO films VALUES (:i, :idN, :date, :nom, :realisateur, :duree, :synopsis, :pays, :annee, :youtube, :couleur, :image, :formatCopie, :langST)', dic)
|
||||||
|
|
||||||
acteursToSq = [{'idFilm' : self.i, 'acteur' : a} for a in dic['acteurs']]
|
acteursToSq = [{'idFilm' : self.i, 'acteur' : a} for a in dic['acteurs']]
|
||||||
c.executemany('INSERT INTO acteurs VALUES (NULL, :idFilm, :acteur)', acteursToSq)
|
c.executemany('INSERT INTO acteurs VALUES (NULL, :idFilm, :acteur)', acteursToSq)
|
||||||
|
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
finally:
|
||||||
c.close()
|
c.close()
|
||||||
#id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT [PRIMARY KEY]
|
#id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT [PRIMARY KEY]
|
||||||
|
|
||||||
|
self.idN = dic['idN']
|
||||||
|
|
||||||
|
|
||||||
def __setattr__(self, nom_attr, val_attr):
|
def __setattr__(self, nom_attr, val_attr):
|
||||||
|
@ -250,6 +251,8 @@ def newFilm():
|
||||||
dic['formatCopie'] = input("format de la copie ? ")
|
dic['formatCopie'] = input("format de la copie ? ")
|
||||||
dic['langST'] = input("langue et sous-titre : VF/VOSTFR ? ")
|
dic['langST'] = input("langue et sous-titre : VF/VOSTFR ? ")
|
||||||
|
|
||||||
seance = filmSQ(dic)
|
|
||||||
return seance
|
print(dic)
|
||||||
|
seance = filmSQ(dic)
|
||||||
|
return (dic,seance)
|
||||||
|
|
||||||
|
|
BIN
filmsShelves2
Normal file
BIN
filmsShelves2
Normal file
Binary file not shown.
Loading…
Reference in a new issue