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
aff88d15
Commit
aff88d15
authored
May 16, 2013
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Version 2.3.3
parent
af88a5b1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
9 deletions
+20
-9
docs/topics/release-notes.md
+4
-1
rest_framework/__init__.py
+1
-1
rest_framework/permissions.py
+5
-0
rest_framework/routers.py
+10
-7
No files found.
docs/topics/release-notes.md
View file @
aff88d15
...
@@ -40,12 +40,15 @@ You can determine your currently installed version using `pip freeze`:
...
@@ -40,12 +40,15 @@ You can determine your currently installed version using `pip freeze`:
## 2.3.x series
## 2.3.x series
### Master
### 2.3.2
*
*Date
**
:
16th May 2013
*
Added SearchFilter
*
Added SearchFilter
*
Added OrderingFilter
*
Added OrderingFilter
*
Added GenericViewSet
*
Added GenericViewSet
*
Bugfix
:
Multiple `@action` and `@link` methods now allowed on viewsets.
*
Bugfix
:
Multiple `@action` and `@link` methods now allowed on viewsets.
*
Bugfix
:
Fix API Root view issue with DjangoModelPermissions
### 2.3.2
### 2.3.2
...
...
rest_framework/__init__.py
View file @
aff88d15
__version__
=
'2.3.
2
'
__version__
=
'2.3.
3
'
VERSION
=
__version__
# synonym
VERSION
=
__version__
# synonym
...
...
rest_framework/permissions.py
View file @
aff88d15
...
@@ -126,6 +126,11 @@ class DjangoModelPermissions(BasePermission):
...
@@ -126,6 +126,11 @@ class DjangoModelPermissions(BasePermission):
if
model_cls
is
None
and
queryset
is
not
None
:
if
model_cls
is
None
and
queryset
is
not
None
:
model_cls
=
queryset
.
model
model_cls
=
queryset
.
model
# Workaround to ensure DjangoModelPermissions are not applied
# to the root view when using DefaultRouter.
if
model_cls
is
None
and
getattr
(
view
,
'_ignore_model_permissions'
):
return
True
assert
model_cls
,
(
'Cannot apply DjangoModelPermissions on a view that'
assert
model_cls
,
(
'Cannot apply DjangoModelPermissions on a view that'
' does not have `.model` or `.queryset` property.'
)
' does not have `.model` or `.queryset` property.'
)
...
...
rest_framework/routers.py
View file @
aff88d15
...
@@ -16,6 +16,7 @@ For example, you might have a `urls.py` that looks something like this:
...
@@ -16,6 +16,7 @@ For example, you might have a `urls.py` that looks something like this:
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
collections
import
namedtuple
from
collections
import
namedtuple
from
rest_framework
import
views
from
rest_framework.compat
import
patterns
,
url
from
rest_framework.compat
import
patterns
,
url
from
rest_framework.decorators
import
api_view
from
rest_framework.decorators
import
api_view
from
rest_framework.response
import
Response
from
rest_framework.response
import
Response
...
@@ -217,14 +218,16 @@ class DefaultRouter(SimpleRouter):
...
@@ -217,14 +218,16 @@ class DefaultRouter(SimpleRouter):
for
prefix
,
viewset
,
basename
in
self
.
registry
:
for
prefix
,
viewset
,
basename
in
self
.
registry
:
api_root_dict
[
prefix
]
=
list_name
.
format
(
basename
=
basename
)
api_root_dict
[
prefix
]
=
list_name
.
format
(
basename
=
basename
)
@api_view
((
'GET'
,))
class
APIRoot
(
views
.
APIView
):
def
api_root
(
request
,
format
=
None
):
_ignore_model_permissions
=
True
ret
=
{}
for
key
,
url_name
in
api_root_dict
.
items
():
ret
[
key
]
=
reverse
(
url_name
,
request
=
request
,
format
=
format
)
return
Response
(
ret
)
return
api_root
def
get
(
self
,
request
,
format
=
None
):
ret
=
{}
for
key
,
url_name
in
api_root_dict
.
items
():
ret
[
key
]
=
reverse
(
url_name
,
request
=
request
,
format
=
format
)
return
Response
(
ret
)
return
APIRoot
.
as_view
()
def
get_urls
(
self
):
def
get_urls
(
self
):
"""
"""
...
...
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