aboutsummaryrefslogtreecommitdiffstats
path: root/examples/blogpost/views.py
diff options
context:
space:
mode:
authorTom Christie2011-06-02 12:58:10 +0100
committerTom Christie2011-06-02 12:58:10 +0100
commitb50492853f537a2473bb0a9eea86c8b0ed6b8824 (patch)
treed289d39aacf187a8a0696a4c1c863aabe1472c3a /examples/blogpost/views.py
parent7ee9adbe5c03c29cd4a894dd476548f7fe73b5e4 (diff)
parentfc1640de75511006e89f033c9270ec91a9f1e4d4 (diff)
downloaddjango-rest-framework-b50492853f537a2473bb0a9eea86c8b0ed6b8824.tar.bz2
pull in -dev as 0.2.0
Diffstat (limited to 'examples/blogpost/views.py')
-rw-r--r--examples/blogpost/views.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/examples/blogpost/views.py b/examples/blogpost/views.py
deleted file mode 100644
index 59a3fb9f..00000000
--- a/examples/blogpost/views.py
+++ /dev/null
@@ -1,32 +0,0 @@
-from djangorestframework.modelresource import ModelResource, RootModelResource
-
-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):
- """A resource with which lists all existing blog posts and creates new blog posts."""
- anon_allowed_methods = allowed_methods = ('GET', 'POST',)
- model = models.BlogPost
- fields = BLOG_POST_FIELDS
-
-class BlogPostInstance(ModelResource):
- """A resource which represents a single blog post."""
- anon_allowed_methods = allowed_methods = ('GET', 'PUT', 'DELETE')
- model = models.BlogPost
- fields = BLOG_POST_FIELDS
-
-class Comments(RootModelResource):
- """A resource which lists all existing comments for a given blog post, and creates new blog comments for a given blog post."""
- anon_allowed_methods = allowed_methods = ('GET', 'POST',)
- model = models.Comment
- fields = COMMENT_FIELDS
-
-class CommentInstance(ModelResource):
- """A resource which represents a single comment."""
- anon_allowed_methods = allowed_methods = ('GET', 'PUT', 'DELETE')
- model = models.Comment
- fields = COMMENT_FIELDS
-