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
f62c874e
Commit
f62c874e
authored
Aug 29, 2014
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove `filter_backend`.
Closes #1775.
parent
d8eb9e6d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
29 deletions
+1
-29
rest_framework/generics.py
+1
-19
rest_framework/settings.py
+0
-10
No files found.
rest_framework/generics.py
View file @
f62c874e
...
@@ -83,7 +83,6 @@ class GenericAPIView(views.APIView):
...
@@ -83,7 +83,6 @@ class GenericAPIView(views.APIView):
slug_url_kwarg
=
'slug'
slug_url_kwarg
=
'slug'
slug_field
=
'slug'
slug_field
=
'slug'
allow_empty
=
True
allow_empty
=
True
filter_backend
=
api_settings
.
FILTER_BACKEND
def
get_serializer_context
(
self
):
def
get_serializer_context
(
self
):
"""
"""
...
@@ -191,24 +190,7 @@ class GenericAPIView(views.APIView):
...
@@ -191,24 +190,7 @@ class GenericAPIView(views.APIView):
"""
"""
Returns the list of filter backends that this view requires.
Returns the list of filter backends that this view requires.
"""
"""
if
self
.
filter_backends
is
None
:
return
list
(
self
.
filter_backends
)
filter_backends
=
[]
else
:
# Note that we are returning a *copy* of the class attribute,
# so that it is safe for the view to mutate it if needed.
filter_backends
=
list
(
self
.
filter_backends
)
if
not
filter_backends
and
self
.
filter_backend
:
warnings
.
warn
(
'The `filter_backend` attribute and `FILTER_BACKEND` setting '
'are deprecated in favor of a `filter_backends` '
'attribute and `DEFAULT_FILTER_BACKENDS` setting, that take '
'a *list* of filter backend classes.'
,
DeprecationWarning
,
stacklevel
=
2
)
filter_backends
=
[
self
.
filter_backend
]
return
filter_backends
# The following methods provide default implementations
# The following methods provide default implementations
# that you may want to override for more complex cases.
# that you may want to override for more complex cases.
...
...
rest_framework/settings.py
View file @
f62c874e
...
@@ -111,9 +111,6 @@ DEFAULTS = {
...
@@ -111,9 +111,6 @@ DEFAULTS = {
),
),
'TIME_FORMAT'
:
None
,
'TIME_FORMAT'
:
None
,
# Pending deprecation
'FILTER_BACKEND'
:
None
,
}
}
...
@@ -129,7 +126,6 @@ IMPORT_STRINGS = (
...
@@ -129,7 +126,6 @@ IMPORT_STRINGS = (
'DEFAULT_PAGINATION_SERIALIZER_CLASS'
,
'DEFAULT_PAGINATION_SERIALIZER_CLASS'
,
'DEFAULT_FILTER_BACKENDS'
,
'DEFAULT_FILTER_BACKENDS'
,
'EXCEPTION_HANDLER'
,
'EXCEPTION_HANDLER'
,
'FILTER_BACKEND'
,
'TEST_REQUEST_RENDERER_CLASSES'
,
'TEST_REQUEST_RENDERER_CLASSES'
,
'UNAUTHENTICATED_USER'
,
'UNAUTHENTICATED_USER'
,
'UNAUTHENTICATED_TOKEN'
,
'UNAUTHENTICATED_TOKEN'
,
...
@@ -196,15 +192,9 @@ class APISettings(object):
...
@@ -196,15 +192,9 @@ class APISettings(object):
if
val
and
attr
in
self
.
import_strings
:
if
val
and
attr
in
self
.
import_strings
:
val
=
perform_import
(
val
,
attr
)
val
=
perform_import
(
val
,
attr
)
self
.
validate_setting
(
attr
,
val
)
# Cache the result
# Cache the result
setattr
(
self
,
attr
,
val
)
setattr
(
self
,
attr
,
val
)
return
val
return
val
def
validate_setting
(
self
,
attr
,
val
):
if
attr
==
'FILTER_BACKEND'
and
val
is
not
None
:
# Make sure we can initialize the class
val
()
api_settings
=
APISettings
(
USER_SETTINGS
,
DEFAULTS
,
IMPORT_STRINGS
)
api_settings
=
APISettings
(
USER_SETTINGS
,
DEFAULTS
,
IMPORT_STRINGS
)
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