def tome_delete(self, id_manga, id_tome):
     db = Database()
     tome = db.retrieveTome(id_manga, id_tome)
     db.deleteTome(tome)
     raise cherrypy.HTTPRedirect('/')
 def tome_delete(self, id_manga, id_tome):
     db = Database()
     tome = db.retrieveTome(id_manga, id_tome)
     db.deleteTome(tome)
     raise cherrypy.HTTPRedirect('/')
Пример #3
0
                            "Voulez vous vraiment supprimer le manga {}, tous les tomes associé seront supprimés ?"
                            .format(manga.titre)))
                    if confirmation == True:
                        db.delete(manga, Manga)
            if action == 2:
                manga = input("Id de la serie ?")
                numero = input("Numéro du tome ?")
                tome = db.retrieveTome(manga, numero)
                if tome != None:
                    nom = db.retrieve(Manga, Manga.id, manga).titre
                    confirmation = bool(
                        input(
                            "Voulez vous vraiment supprimer le tome {} de {} ?"
                            .format(numero, nom)))
                    if confirmation == True:
                        db.deleteTome(tome)
                action = 0

            if action == 3:
                action = None
                liste = db.retrieve(Manga)
                for i in liste:
                    print(i)
                id = input("Id manga ?")
                commentaire = db.retrieve(Commentaire, Commentaire.id, id)
                if commentaire != None:
                    nom = db.retrieve(Manga, Manga.id, id).titre
                    confirmation = bool(
                        input(
                            "Voulez vous vraiment supprimer le commentaire sur le manga {} ?"
                            .format(nom)))
            if action == 1:
                id = input("Id du manga a supprimer ?")
                manga = db.retrieve(Manga, Manga.id, id)
                if manga != None:
                    confirmation = bool(input("Voulez vous vraiment supprimer le manga {}, tous les tomes associé seront supprimés ?".format(manga.titre)))
                    if confirmation == True:
                        db.delete(manga, Manga)
            if action == 2 :
                manga = input("Id de la serie ?")
                numero = input("Numéro du tome ?")
                tome = db.retrieveTome(manga,numero)
                if tome != None:
                    nom = db.retrieve(Manga, Manga.id, manga).titre
                    confirmation = bool(input("Voulez vous vraiment supprimer le tome {} de {} ?".format(numero, nom)))
                    if confirmation == True:
                        db.deleteTome(tome)
                action = 0

            if action == 3:
                action = None
                liste = db.retrieve(Manga)
                for i in liste:
                    print(i)
                id  = input("Id manga ?")
                commentaire = db.retrieve(Commentaire, Commentaire.id, id)
                if commentaire != None:
                    nom = db.retrieve(Manga, Manga.id, id).titre
                    confirmation = bool(input("Voulez vous vraiment supprimer le commentaire sur le manga {} ?".format(nom)))
                    if confirmation == True:
                        db.delete(commentaire, Commentaire)
                action = 0