def refresh_station(self, station): self.left_station = station.get('left') self.arrive_station = station.get('arrive') self.left_station_code = Station.get_station_key_by_name( self.left_station) self.arrive_station_code = Station.get_station_key_by_name( self.arrive_station)
def __init__(self, info, query): self.left_dates = info.get('left_dates') self.left_station = info.get('stations').get('left') self.arrive_station = info.get('stations').get('arrive') self.left_station_code = Station.get_station_key_by_name(self.left_station) self.arrive_station_code = Station.get_station_key_by_name(self.arrive_station) self.account_key = info.get('account_key') self.allow_seats = info.get('seats') self.allow_train_numbers = info.get('train_numbers') self.members = info.get('members') self.member_num = len(self.members) self.member_num_take = self.member_num self.allow_less_member = bool(info.get('allow_less_member')) self.interval = query.interval self.query = query