feat: fix attrbute update
This commit is contained in:
parent
4ec36168a0
commit
917b67484c
1 changed files with 6 additions and 4 deletions
|
@ -128,19 +128,21 @@ class FilmInterface():
|
|||
elif nomAttr == "durée":
|
||||
self.filmCharge.__setattr__(nomAttr, f.input_duree())
|
||||
elif nomAttr == "couleur":
|
||||
self.filmCharge.__setattr__(nomAttr, f.input_color())
|
||||
newValue = f.input_color()
|
||||
elif nomAttr == "date":
|
||||
self.filmCharge.__setattr__(nomAttr, f.input_date())
|
||||
newValue = f.input_date()
|
||||
else:
|
||||
newValue = input(
|
||||
"La valeur actuelle du champ %s est %s.\nVeuillez entrer la nouvelle valeur pour ce champ (et -1 si vous ne souhaitez finalement pas modifier le champ)\n" % (
|
||||
nomAttr, self.filmCharge.__getattr__(nomAttr)))
|
||||
|
||||
if newValue != "-1":
|
||||
iStill = self.filmCharge.__getattr__(nomAttr)
|
||||
self.filmCharge.__setattr__(nomAttr, newValue)
|
||||
if nomAttr == "idN":
|
||||
iStill = self.filmCharge.__getattr__(nomAttr)
|
||||
self.filmCharge.__setattr__(nomAttr, newValue)
|
||||
self.filmCharge = f(iStill)
|
||||
else:
|
||||
self.filmCharge.__setattr__(nomAttr, newValue)
|
||||
else:
|
||||
print("\nVous n'avez finalement pas modifié cet attribut.")
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue