def update_ticekt(name, quantity, price, date, user): ticket = Ticket() ticket.name = name ticket.quantity = quantity ticket.price = price ticket.date = date ticket.user = user db.session.add(ticket) db.session.sell(ticket) db.session.commit()
def sell_ticket(name, quantity, price, date, user): #Used to test the sell ticket function ticket = Ticket() ticket.name = name ticket.quantity = quantity ticket.price = price ticket.date = date ticket.user = user db.session.add(ticket) db.session.commit()
def sell_ticket(name, quantity, price, date, user): """ Create new ticket in the database :param ticket_id: the id of the ticket to be updated :param name: the name of the ticket :param quantity: the amount of tickets for sale :param price: the price of the ticket :param date: the expiry date of the ticket :param user: seller of the ticket :return: an error message if there is any, or None if creation succeeds """ ticket = Ticket() ticket.name = name ticket.quantity = quantity ticket.price = price ticket.date = date ticket.user = user db.session.add(ticket) db.session.commit()