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
44281c39
Commit
44281c39
authored
Oct 10, 2012
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove 'tut 6 - resources' from the docs, since it doesn't exist yet
parent
a3ab66ec
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
4 deletions
+12
-4
docs/index.md
+1
-1
docs/template.html
+1
-1
docs/tutorial/5-relationships-and-hyperlinked-apis.md
+2
-2
rest_framework/resources.py
+8
-0
No files found.
docs/index.md
View file @
44281c39
...
...
@@ -69,7 +69,7 @@ The tutorial will walk you through the building blocks that make up REST framewo
*
[
3 - Class based views
][
tut-3
]
*
[
4 - Authentication, permissions & throttling
][
tut-4
]
*
[
5 - Relationships & hyperlinked APIs
][
tut-5
]
*
[
6 - Resource orientated projects
][
tut-6
]
<!-- * [6 - Resource orientated projects][tut-6]-->
## API Guide
...
...
docs/template.html
View file @
44281c39
...
...
@@ -43,7 +43,7 @@
<li><a
href=
"{{ base_url }}/tutorial/3-class-based-views{{ suffix }}"
>
3 - Class based views
</a></li>
<li><a
href=
"{{ base_url }}/tutorial/4-authentication-permissions-and-throttling{{ suffix }}"
>
4 - Authentication, permissions and throttling
</a></li>
<li><a
href=
"{{ base_url }}/tutorial/5-relationships-and-hyperlinked-apis{{ suffix }}"
>
5 - Relationships and hyperlinked APIs
</a></li>
<
li><a
href=
"{{ base_url }}/tutorial/6-resource-orientated-projects{{ suffix }}"
>
6 - Resource orientated projects
</a></li
>
<
!-- <li><a href="{{ base_url }}/tutorial/6-resource-orientated-projects{{ suffix }}">6 - Resource orientated projects</a></li> --
>
</ul>
</li>
<li
class=
"dropdown"
>
...
...
docs/tutorial/5-relationships-and-hyperlinked-apis.md
View file @
44281c39
...
...
@@ -6,6 +6,6 @@
*
Demonstrate nested relationships
*
Demonstrate and describe hyperlinked relationships
Onwards to
[
part 6
][
tut-6
]
.
<!--
Onwards to
[
part 6
][
tut-6
]
.
[
tut-6
]:
6-resource-orientated-projects.md
[
tut-6
]:
6-resource-orientated-projects.md
-->
rest_framework/resources.py
View file @
44281c39
##### RESOURCES AND ROUTERS ARE NOT YET IMPLEMENTED - PLACEHOLDER ONLY #####
from
functools
import
update_wrapper
import
inspect
from
django.utils.decorators
import
classonlymethod
...
...
@@ -14,6 +16,8 @@ def wrapped(source, dest):
return
dest
##### RESOURCES AND ROUTERS ARE NOT YET IMPLEMENTED - PLACEHOLDER ONLY #####
class
ResourceMixin
(
object
):
"""
Clone Django's `View.as_view()` behaviour *except* using REST framework's
...
...
@@ -57,10 +61,14 @@ class ResourceMixin(object):
return
view
##### RESOURCES AND ROUTERS ARE NOT YET IMPLEMENTED - PLACEHOLDER ONLY #####
class
Resource
(
ResourceMixin
,
views
.
APIView
):
pass
##### RESOURCES AND ROUTERS ARE NOT YET IMPLEMENTED - PLACEHOLDER ONLY #####
class
ModelResource
(
ResourceMixin
,
views
.
APIView
):
root_class
=
generics
.
ListCreateAPIView
detail_class
=
generics
.
RetrieveUpdateDestroyAPIView
...
...
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