def create(movie_id, movie_type, date, time): session.add( Projection(movie_id=movie_id, type=movie_type, date=date, time=time)) session.commit()
def create(user_id, projection_id, row, column): check_seat(projection_id, row, column) reservation = Reservation(user_id=user_id, projection_id=projection_id, row=row, col=column) session.add(reservation) session.flush() session.refresh(reservation) return reservation.id
def create(name, rating): if float(rating) < 0 or float(rating) > 10: raise ValueError("Rating must be in (0, 10)") session.add(Movie(name=name, rating=rating)) session.commit()
def create(username, password): session.add(User(username=username, password=password)) session.commit()