Created
March 26, 2011 02:29
-
-
Save benmcnelly/887972 to your computer and use it in GitHub Desktop.
menu/views.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create your views here. | |
from django.http import HttpResponse | |
from django.shortcuts import render_to_response | |
from django.views.generic.list_detail import object_detail, object_list | |
from djangorestaurant.menu.models import * | |
def item_list(request, page=0, paginate_by=6, template_name='menu/list.html'): | |
items = Item.objects.all() | |
return render_to_response(template_name, {"items":items}) | |
def item_detail(request, item_id, template_name='menu/detail.html'): | |
item = Item.objects.get(id=item_id) | |
return render_to_response(template_name, {"item":item}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment