本文整理汇总了Python中models.Ticket.car_number方法的典型用法代码示例。如果您正苦于以下问题:Python Ticket.car_number方法的具体用法?Python Ticket.car_number怎么用?Python Ticket.car_number使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Ticket
的用法示例。
在下文中一共展示了Ticket.car_number方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handle_ticket
# 需要导入模块: from models import Ticket [as 别名]
# 或者: from models.Ticket import car_number [as 别名]
def handle_ticket(info):
context_dict = {}
ticket = Ticket()
order = info["GtETicket_Response"]["Order"]
ticket.order_id = order["@ID"]
ticket.express_id = order["@ExpressID"]
departure = info["GtETicket_Response"]["Departure"]
ticket.train = departure["@Train"]
ticket.departure_date = departure["@Date"]
ticket.departure_time = departure["@Time"]
ticket.departure_station = departure["@Station"]
arrival = info["GtETicket_Response"]["Arrival"]
ticket.arrival_date = arrival["@Date"]
ticket.arrival_time = arrival["@Time"]
ticket.arrival_station = arrival["@Station"]
car = info["GtETicket_Response"]["Car"]
ticket.car_number = car["@Number"]
ticket.car_type = car["@Type"]
ticket.seat_number = info["GtETicket_Response"]["Seats"]["Seat"]
ticket.price = info["GtETicket_Response"]["Tariff"]
ticket.full_name = info["GtETicket_Response"]["Tickets"]["Ticket"]["Passenger"]["@Name"]
ticket.save()
context_dict['ticket'] = ticket
return context_dict