Exemplo n.º 1
0
def get(cid):
    model = Category.get_model_with_img(cid, throw=True)
    mini_image = File.get(one=True, id=model.mini_img_id)
    if mini_image:
        model.mini_image = Category.get_file_url(mini_image.path)
        model._fields.append('mini_image')
    return jsonify(model)
Exemplo n.º 2
0
def get(cid):
    model = Category.get_model_with_img(cid, throw=True)
    return jsonify(model)