virtualenv --system-site-packages
[davin.git] / ateliers / django / carto_1_1 / annuaire / views.py
CommitLineData
568c139a
DB
1# -*- encoding: utf-8 -*-
2
3from django.shortcuts import render_to_response
4from django.template import Context, RequestContext
5
0f355ca9 6from carto_1_1.annuaire.models import Etablissement, Personne
568c139a 7
0f355ca9
DB
8def 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))
568c139a
DB
14
15def 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))
0f355ca9
DB
21
22
23def 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
30def 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))