ScoDoc/app/views/refcomp.py

31 lines
768 B
Python
Raw Normal View History

2021-12-02 17:36:32 +01:00
"""
PN / Référentiel de compétences
Emmanuel Viennet, 2021
"""
from flask import url_for
from flask import jsonify
from flask import current_app, g, request
from flask.templating import render_template
from flask_login import current_user
from werkzeug.utils import redirect
from config import Config
from app import db
from app import models
from app.decorators import scodoc, permission_required
from app.models.but_refcomp import ApcReferentielCompetences
from app.scodoc.sco_permissions import Permission
from app.views import notes_bp as bp
@bp.route("/pn/comp/<int:refcomp_id>")
@scodoc
@permission_required(Permission.ScoView)
def refcomp(refcomp_id):
ref = ApcReferentielCompetences.query.get_or_404(refcomp_id)
return jsonify(ref.to_dict())