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
8ea1606a
Commit
8ea1606a
authored
Sep 21, 2015
by
Carlton Gibson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Django 1.5 clean_manytomany_helptext fallback
parent
25de8c96
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
13 deletions
+1
-13
rest_framework/compat.py
+0
-11
rest_framework/utils/field_mapping.py
+1
-2
No files found.
rest_framework/compat.py
View file @
8ea1606a
...
...
@@ -106,17 +106,6 @@ try:
except
ImportError
:
django_filters
=
None
if
django
.
VERSION
>=
(
1
,
6
):
def
clean_manytomany_helptext
(
text
):
return
text
else
:
# Up to version 1.5 many to many fields automatically suffix
# the `help_text` attribute with hardcoded text.
def
clean_manytomany_helptext
(
text
):
if
text
.
endswith
(
' Hold down "Control", or "Command" on a Mac, to select more than one.'
):
text
=
text
[:
-
69
]
return
text
# Django-guardian is optional. Import only if guardian is in INSTALLED_APPS
# Fixes (#1712). We keep the try/except for the test suite.
guardian
=
None
...
...
rest_framework/utils/field_mapping.py
View file @
8ea1606a
...
...
@@ -8,7 +8,6 @@ from django.core import validators
from
django.db
import
models
from
django.utils.text
import
capfirst
from
rest_framework.compat
import
clean_manytomany_helptext
from
rest_framework.validators
import
UniqueValidator
NUMERIC_FIELD_TYPES
=
(
...
...
@@ -222,7 +221,7 @@ def get_relation_kwargs(field_name, relation_info):
if
model_field
:
if
model_field
.
verbose_name
and
needs_label
(
model_field
,
field_name
):
kwargs
[
'label'
]
=
capfirst
(
model_field
.
verbose_name
)
help_text
=
clean_manytomany_helptext
(
model_field
.
help_text
)
help_text
=
model_field
.
help_text
if
help_text
:
kwargs
[
'help_text'
]
=
help_text
if
not
model_field
.
editable
:
...
...
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