Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
75cc1eb2
Commit
75cc1eb2
authored
May 16, 2011
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blogpost/views no longer needed
parent
1e04790d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
27 deletions
+0
-27
examples/blogpost/views.py
+0
-27
No files found.
examples/blogpost/views.py
deleted
100644 → 0
View file @
1e04790d
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'
)
class
BlogPosts
(
ListOrCreateModelResource
):
"""A resource with which lists all existing blog posts and creates new blog posts."""
model
=
models
.
BlogPost
fields
=
BLOG_POST_FIELDS
class
BlogPostInstance
(
InstanceModelResource
):
"""A resource which represents a single blog post."""
model
=
models
.
BlogPost
fields
=
BLOG_POST_FIELDS
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
class
CommentInstance
(
InstanceModelResource
):
"""A resource which represents a single comment."""
model
=
models
.
Comment
fields
=
COMMENT_FIELDS
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment