--- /dev/null
+<html>
+ <head>
+ <title>Every Ma'ayanwich Ever!</title></head>
+ <body>
+ <h3>{{ s.adjective }}</h3>
+ <p>Made on {{ s.date_made }} and added by {{ s.user.username }}.</p>
+ <img src="{{ s.picture }}">
+ <h5>Ingredients</h5>
+ <ul>
+ {% for i in s.ingredients.all %}
+ <li>{{ i.name }}
+ {% endfor %}
+ </ul>
+ <h5>Notes</h5>
+ <p> {{ s.notes }}</p>
+ </body>
+</html>
\ No newline at end of file
(r'^addingredient/$', views.add_ingredient),
(r'^allsandwiches/$', views.all_sandwich),
(r'^newsandwiches/$', views.newsandwiches),
+ (r'^sandwich/(?P<slug>[-\w]+)/$', views.specific_sandwich),
)
except Sandwich.DoesNotExist:
raise Http404
return render_to_response('allsandwiches.html', {'sandwiches': sandwiches,})
+
def newsandwiches(request):
try:
sandwiches = Sandwich.objects.order_by('date_made')
except Sandwich.DoesNotExist:
raise Http404
- return render_to_response('allsandwiches.html', {'sandwiches': sandwiches,})
\ No newline at end of file
+ return render_to_response('allsandwiches.html', {'sandwiches': sandwiches,})
+
+
+def specific_sandwich(request, slug):
+ try:
+ sandwiches = Sandwich.objects.get(slug=slug)
+ except Sandwich.DoesNotExist:
+ raise Http404
+ return render_to_response('onesandwich.html', {'s': sandwiches,})
\ No newline at end of file