def run_model(model_name): if data.model_exists(model_name): tasks.run_task(model=data.get_model(model_name), args=request.data if request.data else '') return '', 202 else: abort(404)
def get_model(model_name): model = data.get_model(model_name) i18n = request.args.get('locale', 'en') return jsonify(model.to_primitive()) if model else abort(404)
def get_model(model_name): model = data.get_model(model_name) i18n = request.args.get('locale', 'en') return jsonify(model.to_primitive( role='DTO', context={'locale': i18n})) if model else abort(404)
def get_model(model_name): model = data.get_model(model_name) i18n = request.args.get('locale', 'en') return jsonify(model.to_primitive(role='DTO', context={'locale': i18n})) if model else abort(404)