Пример #1
0
def get_passengers_needs_to_stop():
    current_stop = db_interaction.get_current_station()[0]
    if (current_stop == '__Not_Avaliable__'):
        next_stop = db_interaction.get_next_station()[0]
        passengers = db_interaction.get_pass_info_by_destination(next_stop)
    else:
        passengers = db_interaction.get_pass_info_by_destination(current_stop)
    region1 = 0
    region2 = 0
    for passenger in passengers:
        if passenger[3] == 1:
            region1 = region1 + 1
        if passenger[3] == 2:
            region2 = region2 + 1
    return jsonify({'region1':region1, 'region2':region2})
Пример #2
0
def get_current_stop_for_mobile():
	item = db_interaction.get_current_station()
	return jsonify({'name':"MONGINEVRO EST", 'latitude': item[1], 'longitude': item[2]})
Пример #3
0
def get_current_stop():
    item = db_interaction.get_current_station()
    next_stop_json = prepare_for_json_stops(item)
    return jsonify({'stops': next_stop_json})