Ejemplo n.º 1
0
 def delete(self, id):
     movie_db = self.db.session.query(Movie).filter(Movie.id == id).first()
     if not movie_db:
         raise NotFound("Entity is not found")
     self.db.session.delete(movie_db)
     self.db.session.commit()
     return id
Ejemplo n.º 2
0
 def delete(self, id):
     genre_db = self.db.session.query(Genre).filter(Genre.id == id).first()
     if not genre_db:
         raise NotFound("Entity is not found")
     self.db.session.delete(genre_db)
     self.db.session.commit()
     return id
Ejemplo n.º 3
0
 def update(self, id, movie):
     movie_db = self.db.session.query(Movie).filter(Movie.id == id).first()
     if not movie_db:
         raise NotFound("Entity is not found")
     self.set_data(movie_db, movie)
     self.db.session.commit()
     return movie_db
Ejemplo n.º 4
0
 def update(self, id, genre):
     genre_db = self.db.session.query(Genre).filter(Genre.id == id).first()
     if not genre_db:
         raise NotFound("Entity is not found")
     self.set_data(genre_db, genre)
     self.db.session.commit()
     return genre_db
Ejemplo n.º 5
0
 def delete(self, id):
     actor_db = self.db.session.query(Actor).filter(Actor.id == id).first()
     if not actor_db:
         raise NotFound("Entity is not found")
     self.db.session.delete(actor_db)
     self.db.session.commit()
     return id
Ejemplo n.º 6
0
 def update(self, id, actor):
     actor_db = self.db.session.query(Actor).filter(Actor.id == id).first()
     if not actor_db:
         raise NotFound("Entity is not found")
     self.set_data(actor_db, actor)
     self.db.session.commit()
     return actor_db
Ejemplo n.º 7
0
 def delete(self, id):
     language_db = self.db.session.query(Language).filter(
         Language.id == id).first()
     if not language_db:
         raise NotFound("Entity is not found")
     self.db.session.delete(language_db)
     self.db.session.commit()
     return id
Ejemplo n.º 8
0
 def update(self, id, language):
     language_db = self.db.session.query(Language).filter(
         Language.id == id).first()
     if not language_db:
         raise NotFound("Entity is not found")
     self.set_data(language_db, language)
     self.db.session.commit()
     return language_db