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)
def get(cid): model = Category.get_model_with_img(cid, throw=True) return jsonify(model)