Esempio n. 1
0
def create_schedule(session, day=1):
    schedule = Schedule()
    schedule.station_id = 1
    schedule.day = day
    session.add(schedule)
    session.commit()
    time.sleep(config.SPI_GENERATION_INTERVAL * 3)
    return schedule
def create_schedule(session, day=1):
    schedule = Schedule()
    schedule.station_id = 1
    schedule.day = day
    session.add(schedule)
    session.commit()
    time.sleep(config.SPI_GENERATION_INTERVAL * 3)
    return schedule
Esempio n. 3
0
def radioepg_schedule_add_events(request, id):
    """Add a new event in a station schdule"""

    station = Station.query.filter_by(orga=int(request.args.get('ebuio_orgapk')), id=int(id)).first()
    show = Show.query.filter_by(station_id=station.id, id=int(request.args.get('showPk'))).first()

    (hour, minutes) = request.args.get('start').split(':')

    sche = Schedule()
    sche.show_id = show.id
    sche.station_id = station.id
    sche.day = request.args.get('timeday')
    sche.start_hour = hour
    sche.start_minute = minutes
    sche.length = 60

    db.session.add(sche)
    db.session.commit()

    return {}
Esempio n. 4
0
def radioepg_schedule_add_events(request, id):
    """Add a new event in a station schdule"""

    station = Station.query.filter_by(orga=int(
        request.args.get('ebuio_orgapk')),
                                      id=int(id)).first()
    show = Show.query.filter_by(station_id=station.id,
                                id=int(request.args.get('showPk'))).first()

    (hour, minutes) = request.args.get('start').split(':')

    sche = Schedule()
    sche.show_id = show.id
    sche.station_id = station.id
    sche.day = request.args.get('timeday')
    sche.start_hour = hour
    sche.start_minute = minutes
    sche.length = 60

    db.session.add(sche)
    db.session.commit()

    return {}