sites frontend
[auf_savoirs_en_partage_django.git] / auf_savoirs_en_partage / sites / views.py
1 # -*- encoding: utf-8 -*-
2 from django.shortcuts import render_to_response
3 from django.template import Context, RequestContext
4
5 from models import Site
6
7 def index(request):
8 sites = Site.objects.all()
9 variables = { 'sites': sites,
10 }
11 return render_to_response ("sites/index.html", \
12 Context (variables),
13 context_instance = RequestContext(request))
14
15 def retrieve(request, id):
16 """Fiche du site"""
17 site = Site.objects.get(id=id)
18 variables = { 'site': site,
19 }
20 return render_to_response ("sites/retrieve.html", \
21 Context (variables),
22 context_instance = RequestContext(request))