20 lines
633 B
Python
20 lines
633 B
Python
class TicketPresenter:
|
|
def __init__(self, data):
|
|
self.data = data
|
|
|
|
def as_dict(self):
|
|
return {
|
|
"id": self.data.id,
|
|
"seatNo": self.data.seat_no,
|
|
"seatClass": self.data.seat_class,
|
|
"price": self.data.price,
|
|
"state": self.data.state,
|
|
"trainNo": self.data.train_no,
|
|
"from": self.data.from_station,
|
|
"orderNo": self.data.order.order_no,
|
|
"to": self.data.to_station,
|
|
"date": self.data.date,
|
|
"fromTime": self.data.departure_time,
|
|
"toTime": self.data.arrival_time,
|
|
}
|