aboutsummaryrefslogtreecommitdiffstats
path: root/examples/blogpost/urls.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/blogpost/urls.py')
-rw-r--r--examples/blogpost/urls.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/examples/blogpost/urls.py b/examples/blogpost/urls.py
index c677b8fa..6fde612e 100644
--- a/examples/blogpost/urls.py
+++ b/examples/blogpost/urls.py
@@ -11,9 +11,10 @@ class BlogPostResource(ModelResource):
"""
A Blog Post has a *title* and *content*, and can be associated with zero or more comments.
"""
- model = BlogPost
- fields = ('created', 'title', 'slug', 'content', 'url', 'comments')
- ordering = ('-created',)
+ class Meta:
+ model = BlogPost
+ fields = ('created', 'title', 'slug', 'content', 'url', 'comments')
+ ordering = ('-created',)
def comments(self, instance):
return reverse('comments', kwargs={'blogpost': instance.key})
@@ -23,9 +24,10 @@ class CommentResource(ModelResource):
"""
A Comment is associated with a given Blog Post and has a *username* and *comment*, and optionally a *rating*.
"""
- model = Comment
- fields = ('username', 'comment', 'created', 'rating', 'url', 'blogpost')
- ordering = ('-created',)
+ class Meta:
+ model = Comment
+ fields = ('username', 'comment', 'created', 'rating', 'url', 'blogpost')
+ ordering = ('-created',)
urlpatterns = patterns('',