コード例 #1
0
ファイル: app.py プロジェクト: charliek/c4kmobile
def display_collection_json(id=None):
    collections = lookup_collections(id)
    indent = 5 if request.args.get('format') == 'true' else None
    txt = json.dumps(collections, indent=indent)

    # we want to return a json array as opposed to a dict so we don't use jsonify here
    resp = make_response()
    resp.data = txt
    resp.mimetype = 'application/json'
    return resp
コード例 #2
0
ファイル: app.py プロジェクト: charliek/c4kmobile
def display_collection_html(id):
    collections = lookup_collections(id)
    if len(collections) > 0:
        return render_template('collection.html', collection=collections[0])
    else:
        abort(404)