From 8756664e064a18afc4713d921c318cd968f18433 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 2 May 2011 19:49:12 +0100 Subject: emitters -> renderers --- examples/blogpost/views.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'examples/blogpost/views.py') diff --git a/examples/blogpost/views.py b/examples/blogpost/views.py index e47f4a5b..c4b54f73 100644 --- a/examples/blogpost/views.py +++ b/examples/blogpost/views.py @@ -1,12 +1,11 @@ -from djangorestframework.modelresource import InstanceModelResource, RootModelResource +from djangorestframework.modelresource import InstanceModelResource, ListOrCreateModelResource from blogpost import models BLOG_POST_FIELDS = ('created', 'title', 'slug', 'content', 'absolute_url', 'comment_url', 'comments_url') COMMENT_FIELDS = ('username', 'comment', 'created', 'rating', 'absolute_url', 'blogpost_url') -MAX_POSTS = 10 -class BlogPosts(RootModelResource): +class BlogPosts(ListOrCreateModelResource): """A resource with which lists all existing blog posts and creates new blog posts.""" model = models.BlogPost fields = BLOG_POST_FIELDS @@ -16,7 +15,7 @@ class BlogPostInstance(InstanceModelResource): model = models.BlogPost fields = BLOG_POST_FIELDS -class Comments(RootModelResource): +class Comments(ListOrCreateModelResource): """A resource which lists all existing comments for a given blog post, and creates new blog comments for a given blog post.""" model = models.Comment fields = COMMENT_FIELDS -- cgit v1.2.3