diff options
Diffstat (limited to 'recipe/urls.py')
-rw-r--r-- | recipe/urls.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/recipe/urls.py b/recipe/urls.py index 4c937a0..00bc44a 100644 --- a/recipe/urls.py +++ b/recipe/urls.py | |||
@@ -1,7 +1,10 @@ | |||
1 | from django.conf.urls.defaults import patterns, url | 1 | from django.conf.urls import patterns, url |
2 | from django.views.generic import DetailView, ListView | ||
3 | |||
4 | from recipe.models import Recipe | ||
2 | 5 | ||
3 | 6 | ||
4 | urlpatterns = patterns('recipe.views', | 7 | urlpatterns = patterns('recipe.views', |
5 | url(r'^(?P<slug>[^/]+)', 'recipe_details'), | 8 | url(r'^(?P<slug>[^/]+)', DetailView.as_view(model=Recipe)), |
6 | url(r'^$', 'recipe_list'), | 9 | url(r'^$', ListView.as_view(model=Recipe)), |
7 | ) | 10 | ) |