def get_paginate_by_theme(tid): start, count = paginate() q = request.args.get('q', None) res = Product.get_paginate_models(start, count, q, tid=tid, throw=True) for model in res['models']: model.hide('img_id', 'delete_time', 'category_id') return jsonify(res)
def get_products_by_theme(tid): start, count = paginate() q = request.args.get('q', None) res = Product.get_paginate_models(start, count, q, tid=tid, soft=False, throw=True) products_with_themes(res['models']) return jsonify(res)