Пример #1
0
def create(date=datetime.datetime.today()):
    # Retrieve data from database first
    DataRequest('agency', '/agency/agency.json').get()
    DataRequest('holiday', '/route/holiday.json').get()
    DataRequest('joint', '/route/joint.json').get()
    DataRequest('route', '/route/route.json').get()
    DataRequest('schedule', '/route/schedule.json').get()
    DataRequest('segment', '/route/segment.json').get()
    DataRequest('segment_order', '/route/segment_order.json').get()
    DataRequest('service', '/route/service.json').get()
    DataRequest('stop', '/stop/stop.json').get()
    DataRequest('stop_seq', '/route/stop_seq.json').get()

    # Load dependent data
    Stop.load()
    load_segments()
    Service.load()

    # Then process by loading the obtained data
    Joint.load()
    SegmentOrder.load()
    Schedule.load()
    Joint.process()
    Route.set_route_query()
    StopTime.publish_matrix()
    Driver.export()
    Trip.export()
    StopTime.export()
    feed = DateRange.get_obj_by_date(date).get_default_feed()
    DateRange.export()
    return feed
Пример #2
0
def load(date=datetime.datetime.today()):
    Stop.load()
    load_segments()
    Service.load()
    Joint.load()
    SegmentOrder.load()
    Schedule.load()
    DateRange.load()
    Driver.load()
    Trip.load()
    StopTime.load()
    Route.set_route_query()
    return DateRange.get_obj_by_date(date).get_default_feed()