page perso : kickoff
[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 index(request):
11 return render_to_response('rh/index.html', {}, RequestContext(request))
12
13 def perso(request, id):
14 """Espace personnel de l'employé."""
15 try:
16 employe = rh.Employe.objects.get(pk=id)
17 except:
18 employe = rh.Employe.none()
19 c = {
20 'user':request.user,
21 'employe':employe,
22 }
23 return render_to_response('rh/perso.html', c, RequestContext(request))
24
25 # employes
26 def employes_liste(request):
27 """Liste des employés."""
28 employes = rh.Employe.objects.all()
29 c = {
30 'user':request.user,
31 'employes':employes,
32 }
33 return render_to_response('rh/employes_liste.html', c, RequestContext(request))
34
35 def employe(request, id):
36 """Information publique sur un employé."""
37 try:
38 employe = rh.Employe.objects.get(pk=id)
39 except:
40 employe = rh.Employe.objects.none()
41 c = {
42 'user':request.user,
43 'employe':employe,
44 }
45 return render_to_response('rh/employe.html', c, RequestContext(request))