def initialise_graphe(request): if not request.user.has_perm('application.est_admin'): return {'success':False,'msg':'Droits insuffisants'} if 'graphe' in request.POST and request.POST['graphe']!='': ok=Graphe_competences.init_graphe_sql(graphe=request.POST['graphe'], niveau=request.POST['niveau'], competence_id=request.POST['id']) else: ok=Graphe_competences.init_graphe_sql(niveau=request.POST['niveau'], competence_id=request.POST['id']) if ok: msg=u'Graphe initialisé' else: msg=u'Erreur d\'initialisation du graphe' return {'success':ok,'msg':msg}
def init_test(): Graphe_competences.delete_graphe(0) Graphe_competences.delete_graphe(1) Graphe_competences.delete_graphe(2) Graphe_competences.delete_graphe(3) Graphe_competences.init_graphe_sql(niveau=0, competence_id=917, graphe=0) Graphe_competences.init_graphe_sql(niveau=1, competence_id=927, graphe=1) Graphe_competences.init_graphe_sql(niveau=2, competence_id=941, graphe=2) Graphe_competences.init_graphe_sql(niveau=2, competence_id=949, graphe=3)