virtualenv --system-site-packages
[davin.git] / ateliers / django / carto_1_1 / annuaire / views.py
1 # -*- encoding: utf-8 -*-
2
3 from django.shortcuts import render_to_response
4 from django.template import Context, RequestContext
5
6 from carto_1_1.annuaire.models import Etablissement, Personne
7
8 def etablissement_list(request):
9 etablissements = Etablissement.objects.all()
10 c = {
11 'etablissements': etablissements,
12 }
13 return render_to_response("annuaire/etablissement_list.html", Context(c), context_instance = RequestContext(request))
14
15 def etablissement_detail(request, id):
16 etablissement = Etablissement.objects.get(id=id)
17 c = {
18 'etablissement': etablissement,
19 }
20 return render_to_response("annuaire/etablissement_detail.html", Context(c), context_instance = RequestContext(request))
21
22
23 def personne_list(request):
24 personnes = Personne.objects.all()
25 c = {
26 'personnes': personnes,
27 }
28 return render_to_response("annuaire/personne_list.html", Context(c), context_instance = RequestContext(request))
29
30 def personne_detail(request, id):
31 personne = Personne.objects.get(id=id)
32 c = {
33 'personne': personne,
34 }
35 return render_to_response("annuaire/personne_detail.html", Context(c), context_instance = RequestContext(request))