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
ee8ab283
Commit
ee8ab283
authored
Oct 29, 2012
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Style tweaks
parent
49f87cfb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
rest_framework/decorators.py
+12
-2
rest_framework/static/rest_framework/css/default.css
+1
-0
rest_framework/templates/rest_framework/base.html
+1
-1
No files found.
rest_framework/decorators.py
View file @
ee8ab283
...
@@ -10,8 +10,18 @@ def api_view(http_method_names):
...
@@ -10,8 +10,18 @@ def api_view(http_method_names):
def
decorator
(
func
):
def
decorator
(
func
):
class
WrappedAPIView
(
APIView
):
WrappedAPIView
=
type
(
pass
'WrappedAPIView'
,
(
APIView
,),
{
'__doc__'
:
func
.
__doc__
}
)
# Note, the above allows us to set the docstring.
# It is the equivelent of:
#
# class WrappedAPIView(APIView):
# pass
# WrappedAPIView.__doc__ = func.doc <--- Not possible to do this
allowed_methods
=
set
(
http_method_names
)
|
set
((
'options'
,))
allowed_methods
=
set
(
http_method_names
)
|
set
((
'options'
,))
WrappedAPIView
.
http_method_names
=
[
method
.
lower
()
for
method
in
allowed_methods
]
WrappedAPIView
.
http_method_names
=
[
method
.
lower
()
for
method
in
allowed_methods
]
...
...
rest_framework/static/rest_framework/css/default.css
View file @
ee8ab283
...
@@ -59,6 +59,7 @@ pre {
...
@@ -59,6 +59,7 @@ pre {
.page-header
{
.page-header
{
border-bottom
:
none
;
border-bottom
:
none
;
padding-bottom
:
0px
;
padding-bottom
:
0px
;
margin-bottom
:
20px
;
}
}
...
...
rest_framework/templates/rest_framework/base.html
View file @
ee8ab283
...
@@ -109,7 +109,7 @@
...
@@ -109,7 +109,7 @@
<div
class=
"content-main"
>
<div
class=
"content-main"
>
<div
class=
"page-header"
><h1>
{{ name }}
</h1></div>
<div
class=
"page-header"
><h1>
{{ name }}
</h1></div>
<p
class=
"resource-description"
>
{{ description }}
</p>
{{ description }}
<div
class=
"request-info"
>
<div
class=
"request-info"
>
<pre
class=
"prettyprint"
><b>
{{ request.method }}
</b>
{{ request.get_full_path }}
</pre>
<pre
class=
"prettyprint"
><b>
{{ request.method }}
</b>
{{ request.get_full_path }}
</pre>
...
...
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