Beispiel #1
0
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)
Beispiel #2
0
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)
Beispiel #3
0
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)
Beispiel #4
0
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)
Beispiel #5
0
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)