コード例 #1
0
 def create(movie_id, movie_type, date, time):
     session.add(
         Projection(movie_id=movie_id,
                    type=movie_type,
                    date=date,
                    time=time))
     session.commit()
コード例 #2
0
 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
コード例 #3
0
 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()
コード例 #4
0
 def create(username, password):
     session.add(User(username=username, password=password))
     session.commit()