1 from django.shortcuts import render_to_response, get_object_or_404
\r
2 from django.template import RequestContext, Template, TemplateSyntaxError
\r
4 from libraries.models import Catalog
\r
7 def main_view(request):
\r
8 context = RequestContext(request)
\r
9 context['catalogs'] = Catalog.objects.all()
\r
10 return render_to_response('libraries/main_view.html', context_instance = context)
\r
12 def library_view(request, slug):
\r
13 context = RequestContext(request)
\r
14 context['catalog'] = get_object_or_404(Catalog.objects.filter(slug = slug).select_related())
\r
15 return render_to_response('libraries/library_view.html', context_instance = context)