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
9bcb1477
Commit
9bcb1477
authored
Aug 27, 2015
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor tweaks
parent
aeb57913
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
rest_framework/filters.py
+3
-4
No files found.
rest_framework/filters.py
View file @
9bcb1477
...
...
@@ -10,7 +10,7 @@ from functools import reduce
from
django.conf
import
settings
from
django.core.exceptions
import
ImproperlyConfigured
from
django.db
import
models
from
django.template
import
Context
,
Template
,
loader
from
django.template
import
Context
,
loader
from
django.utils
import
six
from
rest_framework.compat
import
(
...
...
@@ -18,12 +18,11 @@ from rest_framework.compat import (
)
from
rest_framework.settings
import
api_settings
if
'crispy_forms'
in
settings
.
INSTALLED_APPS
and
crispy_forms
and
django_filters
:
# If django-crispy-forms is installed, use it to get a bootstrap3 rendering
# of the DjangoFilterBackend controls when displayed as HTML.
from
crispy_forms.helper
import
FormHelper
from
crispy_forms.layout
import
Field
,
Fieldset
,
Layout
,
Submit
from
crispy_forms.layout
import
Layout
,
Submit
class
FilterSet
(
django_filters
.
FilterSet
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
...
...
@@ -238,7 +237,7 @@ class OrderingFilter(BaseFilterBackend):
elif
valid_fields
==
'__all__'
:
# View explicitly allows filtering on any model field
valid_fields
=
[
(
field
.
name
,
field
.
label
)
(
field
.
name
,
getattr
(
field
,
'label'
,
field
.
name
.
title
())
)
for
field
in
queryset
.
model
.
_meta
.
fields
]
valid_fields
+=
[
...
...
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