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
61f3ccf3
Commit
61f3ccf3
authored
Feb 04, 2016
by
Xavier Ordoquy
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3903 from charettes/deprecation-warnings-1.8
Silenced deprecation warnings on Django 1.8.
parents
24c48500
1a052d6e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
rest_framework/compat.py
+2
-2
No files found.
rest_framework/compat.py
View file @
61f3ccf3
...
@@ -251,7 +251,7 @@ def get_all_related_objects(opts):
...
@@ -251,7 +251,7 @@ def get_all_related_objects(opts):
:param opts: Options instance
:param opts: Options instance
:return: list of relations except many-to-many ones
:return: list of relations except many-to-many ones
"""
"""
if
django
.
VERSION
<
(
1
,
9
):
if
django
.
VERSION
<
(
1
,
8
):
return
opts
.
get_all_related_objects
()
return
opts
.
get_all_related_objects
()
else
:
else
:
return
[
r
for
r
in
opts
.
related_objects
if
not
r
.
field
.
many_to_many
]
return
[
r
for
r
in
opts
.
related_objects
if
not
r
.
field
.
many_to_many
]
...
@@ -264,7 +264,7 @@ def get_all_related_many_to_many_objects(opts):
...
@@ -264,7 +264,7 @@ def get_all_related_many_to_many_objects(opts):
:param opts: Options instance
:param opts: Options instance
:return: list of many-to-many relations
:return: list of many-to-many relations
"""
"""
if
django
.
VERSION
<
(
1
,
9
):
if
django
.
VERSION
<
(
1
,
8
):
return
opts
.
get_all_related_many_to_many_objects
()
return
opts
.
get_all_related_many_to_many_objects
()
else
:
else
:
return
[
r
for
r
in
opts
.
related_objects
if
r
.
field
.
many_to_many
]
return
[
r
for
r
in
opts
.
related_objects
if
r
.
field
.
many_to_many
]
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