X-Git-Url: http://git.ithinksw.org/~kgodey/maayanwich.git/blobdiff_plain/d70badd3a28a3b951b32e4cf36562ec3cfd9dd41..4c304fe631bb60e070fc61d92baeec11825488d7:/views.py diff --git a/views.py b/views.py index cb8e7e6..18f6ea1 100644 --- a/views.py +++ b/views.py @@ -45,7 +45,7 @@ def add_ingredient(request): form = IngredientForm() # An unbound form return render_to_response('ingredient.html', {'iform': form, 'sandwiches': sandwiches}) - + def all_sandwich(request): try: @@ -58,7 +58,7 @@ def all_sandwich(request): raise Http404 return render_to_response('allsandwiches.html', {'allsandwiches': allsandwiches, 'sandwiches': sandwiches}) - + def baseview(request): try: if Sandwich.objects.count() > 5: @@ -70,16 +70,16 @@ def baseview(request): except Sandwich.DoesNotExist: raise Http404 return render_to_response('base.html', {'sandwiches': sandwiches, 'all': allsandwiches,}) - - + + 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: s = Sandwich.objects.get(slug=slug) @@ -115,7 +115,8 @@ def login_view(request): except KeyError: aform = AuthenticationForm() return render_to_response('login.html', {'aform': aform, 'sandwiches': sandwiches,}) - + + def create_user(request): if Sandwich.objects.count() > 5: sandwiches = Sandwich.objects.order_by('date_made')[:5]