From 027e4aceedf8cc32dc3e2dcb026fe645368ee9ad Mon Sep 17 00:00:00 2001 From: Alice Date: Wed, 7 Feb 2018 20:36:13 +0100 Subject: [PATCH] train --- baseFilm.db | 0 baseFilms (kopio 1).db | Bin 0 -> 32768 bytes cineclubBlogSQ.py | 21 ++++++++++++--------- filmsShelves2 | Bin 0 -> 12288 bytes 4 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 baseFilm.db create mode 100644 baseFilms (kopio 1).db create mode 100644 filmsShelves2 diff --git a/baseFilm.db b/baseFilm.db new file mode 100644 index 0000000..e69de29 diff --git a/baseFilms (kopio 1).db b/baseFilms (kopio 1).db new file mode 100644 index 0000000000000000000000000000000000000000..ef5948e0f30235bd5acb2dfec13832e8c924c1bb GIT binary patch literal 32768 zcmeI)Pfyxl90%||<)202(KyyD9PHd>L|FhmY=%)^#! zS+du%SFxLKV8;hCZcf-p;Uf~t?INOhj7pK7nL-jgBAS>e(2c_fk%0+Vz8=m-8f`h9XPx;}L} zbvh&pn;-xI2tWV=5P$##AaFYZpZVR8EX(Z6`;NBT)c1|1X}dFVrKo1hs#4BA&#Q{N zN_iMo{wao%E0onWwWwq(<;`lYKye#tp{#5ba~s*>j!M|uZWnzck9DnS*c9G9zG&31_wKQ-_m02c9_*8r)wT_LU=MBW zWbj6<)f(RYiPi0NclE(Z>{;EWlYmFuH&MgX8bi9cxbRuA+QyJZO|8`^mEGe=M5Axn zz1w*+{^xs5$U*t3%mkxV*WcMkO}ehEYTb_IzOK5bNHy&)LR@sOEQKv!P+nMIJMPKl zh1mL0S8wg<*IxRsoN(7RK5S{GzDSV?o)nU?pqz~lIu32mdC%L`wD%-Ps;_P?o4$Ed zYWZ>QPDqZ&*{7JBp|?wK5xA1kytj6qh7qY|)N4|2;OLD2e-9b%XmUB2R0_H63Jn4j z_=1M0npE1z=JV7+rBKSP71Y(sVT9T^ST)HRUBZb79i_;>3j7DnP#^#S2tWV=5P$## zAOHafKmY;|xLtvi$Qi#sGs9wBoRwmnFPoWE`f)P#B$>%r?Y1R0_YWKG(9gqz!^1b- zgT}!F=0tFs@d++PIA5ZOR4SQD(`1?flggTxlyfiNx!3R1khcyC2tWV=5P$##AOHaf zKmY;|fB*zWL?FU{35=f!{EQyoMkFbu0Rad=00Izz00bZa0SG_<0uUHif$)ScE_r`r zKn9bZgY*4=MxO!DgaQEwKmY;|fB*y_009U<00Izzz$ghw%rEd5{eK3#6Q;Zv|1Hpj z0s#m>00Izz00bZa0SG_<0uX?}2nzUolH^?fi_ZQ3b9@6}1b@Ux2?7v+00bZa0SG_< u0uX=z1jbn);A3oA^!u2!G|mjj9Rd)500bZa0SG_<0uX=z1RyXj0)GJAArZv@ literal 0 HcmV?d00001 diff --git a/cineclubBlogSQ.py b/cineclubBlogSQ.py index 9608b5f..f49d45a 100644 --- a/cineclubBlogSQ.py +++ b/cineclubBlogSQ.py @@ -24,21 +24,22 @@ class filmSQ(): def __init__(self, dic): """ceci est une aide""" - self.idN = dic['idN'] - conn = sqlite3.connect("baseFilms.db") conn.row_factory = sqlite3.Row c = conn.cursor() - c.execute('INSERT INTO films VALUES (:i, :idN, :date, :nom, :realisateur, :duree, :synopsis, :pays, :annee, :youtube, :couleur, :image, :formatCopie, :langST)', dic) + try: + 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']] - c.executemany('INSERT INTO acteurs VALUES (NULL, :idFilm, :acteur)', acteursToSq) - - conn.commit() - c.close() + acteursToSq = [{'idFilm' : self.i, 'acteur' : a} for a in dic['acteurs']] + c.executemany('INSERT INTO acteurs VALUES (NULL, :idFilm, :acteur)', acteursToSq) + + conn.commit() + finally: + c.close() #id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT [PRIMARY KEY] + self.idN = dic['idN'] def __setattr__(self, nom_attr, val_attr): @@ -250,6 +251,8 @@ def newFilm(): dic['formatCopie'] = input("format de la copie ? ") dic['langST'] = input("langue et sous-titre : VF/VOSTFR ? ") + + print(dic) seance = filmSQ(dic) - return seance + return (dic,seance) diff --git a/filmsShelves2 b/filmsShelves2 new file mode 100644 index 0000000000000000000000000000000000000000..51cdaa22ec5092cc224e556989dc65ae4c3b4922 GIT binary patch literal 12288 zcmeI%F$#k~5Jus#O(l2%kB}pHi`>l{+2lYraVCohc4>sjH!wIXEXd>iyT!ie*ARWg z-j5t>Ug|qVtX&NX0R#|0009ILKmY**5I_I{1pb=9n18P^-~b0WzyS_$fCC)h00%h0 z0S?^Sf$#Hvz5hS6f2>c|d5g6O3^1r%@BjlIv>QSeWI+~Wp%IV;S&#);*a