ergo : block titre vient de settings
[auf_rh_dae.git] / project / rh / views.py
1 # -*- encoding: utf-8 -*-
2 from django.shortcuts import redirect, render_to_response, get_object_or_404
3 from django.template import RequestContext
4
5 #from datamaster_modeles import models as ref
6 from project.rh import models as rh
7
8
9 # homes
10 def perso(request, id):
11 """Espace personnel de l'employé."""
12 try:
13 employe = rh.Employe.objects.get(pk=id)
14 except:
15 employe = rh.Employe.none()
16 c = {
17 'user':request.user,
18 'employe':employe,
19 }
20 return render_to_response('rh/perso.html', c, RequestContext(request))
21
22 # employes
23 def employes_liste(request):
24 """Liste des employés."""
25 employes = rh.Employe.objects.all()
26 c = {
27 'user':request.user,
28 'employes':employes,
29 }
30 return render_to_response('rh/employes_liste.html', c, RequestContext(request))
31
32 def employe(request, id):
33 """Information publique sur un employé."""
34 try:
35 employe = rh.Employe.objects.get(pk=id)
36 except:
37 employe = rh.Employe.objects.none()
38 c = {
39 'user':request.user,
40 'employe':employe,
41 }
42 return render_to_response('rh/employe.html', c, RequestContext(request))