X-Git-Url: http://git.ithinksw.org/~kgodey/maayanwich.git/blobdiff_plain/cf85775b60d096583ec64a257e8a6afe47e21cd2..d4c7020dea9dfb1de97b9048b70d168c52022d79:/views.py diff --git a/views.py b/views.py index 872104f..efced1f 100644 --- a/views.py +++ b/views.py @@ -55,6 +55,13 @@ def newsandwiches(request): raise Http404 return render_to_response('allsandwiches.html', {'sandwiches': sandwiches,}) +def sandwich_month(request, year, month): + try: + sandwiches = Sandwich.objects.filter(date_made__month=month, date_made__year=year) + except Sandwich.DoesNotExist: + raise Http404 + return render_to_response('allsandwiches.html', {'sandwiches': sandwiches,}) + def specific_sandwich(request, slug): try: