summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Crute <mcrute@gmail.com>2010-12-29 17:47:42 -0500
committerMike Crute <mcrute@gmail.com>2010-12-29 17:47:42 -0500
commitdeb2f6420e4f44f6d5d731abbd3340c258a0cc52 (patch)
tree945248ee96152b9396c4ca7abbf8836c725c1066
parentda8c20c181eb7aac8755c617c9425896ce8cb827 (diff)
downloadgreenbox-deb2f6420e4f44f6d5d731abbd3340c258a0cc52.tar.bz2
greenbox-deb2f6420e4f44f6d5d731abbd3340c258a0cc52.tar.xz
greenbox-deb2f6420e4f44f6d5d731abbd3340c258a0cc52.zip
Adding recipe list
-rw-r--r--greenbox/recipe/urls.py6
-rw-r--r--greenbox/recipe/views.py7
-rw-r--r--greenbox/templates/recipe/recipe_list.html5
-rw-r--r--greenbox/urls.py18
4 files changed, 21 insertions, 15 deletions
diff --git a/greenbox/recipe/urls.py b/greenbox/recipe/urls.py
new file mode 100644
index 0000000..d344e0a
--- /dev/null
+++ b/greenbox/recipe/urls.py
@@ -0,0 +1,6 @@
1from django.conf.urls.defaults import patterns, url
2
3
4urlpatterns = patterns('recipe.views',
5 url(r'^$', 'recipe_list'),
6)
diff --git a/greenbox/recipe/views.py b/greenbox/recipe/views.py
index 60f00ef..d1872c5 100644
--- a/greenbox/recipe/views.py
+++ b/greenbox/recipe/views.py
@@ -1 +1,6 @@
1# Create your views here. 1from models import Recipe
2from django.views.generic.list_detail import object_list
3
4
5def recipe_list(request):
6 return object_list(request, queryset=Recipe.objects.all())
diff --git a/greenbox/templates/recipe/recipe_list.html b/greenbox/templates/recipe/recipe_list.html
new file mode 100644
index 0000000..3ceae72
--- /dev/null
+++ b/greenbox/templates/recipe/recipe_list.html
@@ -0,0 +1,5 @@
1<ul>
2{% for recipe in object_list %}
3 <li>{{ recipe.title }}</li>
4{% endfor %}
5</ul>
diff --git a/greenbox/urls.py b/greenbox/urls.py
index 9202bff..7ee6f28 100644
--- a/greenbox/urls.py
+++ b/greenbox/urls.py
@@ -1,17 +1,7 @@
1from django.conf.urls.defaults import * 1from django.conf.urls.defaults import patterns, include, url
2 2from django.contrib import admin; admin.autodiscover()
3# Uncomment the next two lines to enable the admin:
4from django.contrib import admin
5admin.autodiscover()
6 3
7urlpatterns = patterns('', 4urlpatterns = patterns('',
8 # Example: 5 url(r'^$', include('recipe.urls')),
9 # (r'^greenbox/', include('greenbox.foo.urls')), 6 url(r'^admin/', include(admin.site.urls)),
10
11 # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
12 # to INSTALLED_APPS to enable admin documentation:
13 # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
14
15 # Uncomment the next line to enable the admin:
16 (r'^admin/', include(admin.site.urls)),
17) 7)