diff options
| author | Tom Christie | 2011-05-02 19:49:12 +0100 |
|---|---|---|
| committer | Tom Christie | 2011-05-02 19:49:12 +0100 |
| commit | 8756664e064a18afc4713d921c318cd968f18433 (patch) | |
| tree | 8eb4499900552963f88972d0853e68d05159295f /examples/blogpost/views.py | |
| parent | b358fbdbe9cbd4ce644c4b2c7b9b4cec0811e14e (diff) | |
| download | django-rest-framework-8756664e064a18afc4713d921c318cd968f18433.tar.bz2 | |
emitters -> renderers
Diffstat (limited to 'examples/blogpost/views.py')
| -rw-r--r-- | examples/blogpost/views.py | 7 |
1 files changed, 3 insertions, 4 deletions
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 |
