page perso : kickoff
[auf_rh_dae.git] / project / rh / views.py
index 566f922..2aae70a 100644 (file)
@@ -2,7 +2,44 @@
 from django.shortcuts import redirect, render_to_response, get_object_or_404
 from django.template import RequestContext
 
+#from datamaster_modeles import models as ref
 from project.rh import models as rh
 
+
+# homes
 def index(request):
     return render_to_response('rh/index.html', {}, RequestContext(request))
+    
+def perso(request, id):
+    """Espace personnel de l'employé."""
+    try:
+        employe = rh.Employe.objects.get(pk=id)
+    except:
+        employe = rh.Employe.none()
+    c = {
+        'user':request.user,
+        'employe':employe,
+        }
+    return render_to_response('rh/perso.html', c, RequestContext(request))
+    
+# employes
+def employes_liste(request):
+    """Liste des employés."""
+    employes = rh.Employe.objects.all()
+    c = {
+        'user':request.user,
+        'employes':employes,
+        }
+    return render_to_response('rh/employes_liste.html', c, RequestContext(request))
+    
+def employe(request, id):
+    """Information publique sur un employé."""
+    try:
+        employe = rh.Employe.objects.get(pk=id)
+    except:
+        employe = rh.Employe.objects.none()
+    c = {
+        'user':request.user,
+        'employe':employe,
+        }
+    return render_to_response('rh/employe.html', c, RequestContext(request))