Esempio n. 1
0
def podcast():
    uuid = request.form.get('uuid', None)
    channel_uuid = request.form.get('channel_uuid', None)

    if uuid:
        podcasts = Podcast().get(limit=10, uuid=uuid)
    elif channel_uuid:
        channel = Channel.get(uuid=channel_uuid)
        podcasts = Podcast.get(limit=10, channel=channel)

    total = []
    for item in podcasts:
        total.append(item.as_dict(['id', 'user_id', 'channel_id']))

    return json.dumps({'podcasts': total}), 200
Esempio n. 2
0
def podcast():
    uuid = request.form.get('uuid', None)
    channel_uuid = request.form.get('channel_uuid', None)

    if uuid:
        podcasts = Podcast().get(limit=10, uuid=uuid)
    elif channel_uuid:
        channel = Channel.get(uuid=channel_uuid)
        podcasts = Podcast.get(limit=10, channel=channel)

    total = []
    for item in podcasts:
        total.append(item.as_dict(['id', 'user_id', 'channel_id']))

    return json.dumps({'podcasts': total}), 200
Esempio n. 3
0
def get_channel(channel_id):
    return jsonify(data=Channel.get(id=channel_id)), 200
Esempio n. 4
0
def get_channel(channel_id):
    return jsonify(data=Channel.get(id=channel_id)), 200