diff options
author | luxagraf <sng@luxagraf.net> | 2023-07-28 13:39:02 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2023-07-28 13:39:02 -0500 |
commit | 9a620cf42bf1fe6977e378bd834b41ff4a593dde (patch) | |
tree | cf41a0582681cecaf88a30bfe409f9c2be57972a /bak/unused_apps/guide/views.py | |
parent | 6e5897117124cd60ae81efb1574c6347f48e60e5 (diff) |
main: removed some apps I wasn't using and added bak to git to preserve
a copy of old apps
Diffstat (limited to 'bak/unused_apps/guide/views.py')
-rw-r--r-- | bak/unused_apps/guide/views.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/bak/unused_apps/guide/views.py b/bak/unused_apps/guide/views.py new file mode 100644 index 0000000..c22a6b3 --- /dev/null +++ b/bak/unused_apps/guide/views.py @@ -0,0 +1,35 @@ +from django.shortcuts import render_to_response, get_object_or_404 +from django.template import RequestContext + +from guide.models import Guide + + +def guide_list(request, page): + """List of all guides""" + request.page_url = "/guide/%d/" + request.page = int(page) + context = { + 'object_list': Guide.objects.filter(status__exact=1).order_by('-pub_date').select_related(), + 'page': page, + } + return render_to_response("archives/guide.html", context, context_instance=RequestContext(request)) + + +def guide_list_by_location(request, location): + context = { + "object_list": Guide.objects.filter(location__slug__exact=location), + } + return render_to_response("archives/guide.html", context, context_instance=RequestContext(request)) + + +def location_list(request): + """List of all locations with guides""" + context = { + "object_list": Guide.objects.filter(status__exact=1).order_by('-pub_date').select_related() + } + return render_to_response("archives/guide.html", context, context_instance=RequestContext(request)) + + +def guide_detail(request, slug, location=None): + obj = get_object_or_404(Guide, slug__exact=slug) + return render_to_response('details/guide.html', {'object': obj}, context_instance=RequestContext(request)) |