From 67c48f758f3a3aa435e4f2ccf41764ae596447fb Mon Sep 17 00:00:00 2001 From: tom christie tom@tomchristie.com Date: Sat, 19 Feb 2011 17:55:32 +0000 Subject: Fix kwargs in url conf to be more consistent, also fixes broken blog posts example (every blog post showed all comments) --- examples/blogpost/models.py | 2 +- examples/blogpost/urls.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/blogpost/models.py b/examples/blogpost/models.py index c85ca788..ba7810dc 100644 --- a/examples/blogpost/models.py +++ b/examples/blogpost/models.py @@ -30,7 +30,7 @@ class BlogPost(models.Model): @models.permalink def comments_url(self): """Link to a resource which lists all comments for this blog post.""" - return ('comments', (), {'blogpost_id': self.key}) + return ('comments', (), {'blogpost': self.key}) def __unicode__(self): return self.title diff --git a/examples/blogpost/urls.py b/examples/blogpost/urls.py index b2df96a1..1306b0d7 100644 --- a/examples/blogpost/urls.py +++ b/examples/blogpost/urls.py @@ -4,6 +4,6 @@ from blogpost.views import BlogPosts, BlogPostInstance, Comments, CommentInstanc urlpatterns = patterns('', url(r'^$', BlogPosts.as_view(), name='blog-posts'), url(r'^(?P[^/]+)/$', BlogPostInstance.as_view(), name='blog-post'), - url(r'^(?P[^/]+)/comments/$', Comments.as_view(), name='comments'), + url(r'^(?P[^/]+)/comments/$', Comments.as_view(), name='comments'), url(r'^(?P[^/]+)/comments/(?P[^/]+)/$', CommentInstance.as_view(), name='comment'), ) -- cgit v1.2.3