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
8f79caf9
Commit
8f79caf9
authored
Jul 05, 2013
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use 'force_text', not 'unicode', for compat across python version
parent
676ab497
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
rest_framework/fields.py
+3
-3
rest_framework/tests/test_serializer.py
+1
-1
No files found.
rest_framework/fields.py
View file @
8f79caf9
...
@@ -102,13 +102,13 @@ def humanize_strptime(format_string):
...
@@ -102,13 +102,13 @@ def humanize_strptime(format_string):
def
strip_multiple_choice_msg
(
help_text
):
def
strip_multiple_choice_msg
(
help_text
):
"""
"""
Remove the 'Hold down "control" ...' message that is
enforced in select
Remove the 'Hold down "control" ...' message that is
Django enforces in
multiple fields.
select multiple fields on ModelForms. (Required for 1.5 and earlier)
See https://code.djangoproject.com/ticket/9321
See https://code.djangoproject.com/ticket/9321
"""
"""
multiple_choice_msg
=
_
(
' Hold down "Control", or "Command" on a Mac, to select more than one.'
)
multiple_choice_msg
=
_
(
' Hold down "Control", or "Command" on a Mac, to select more than one.'
)
multiple_choice_msg
=
unicode
(
multiple_choice_msg
)
multiple_choice_msg
=
force_text
(
multiple_choice_msg
)
return
help_text
.
replace
(
multiple_choice_msg
,
''
)
return
help_text
.
replace
(
multiple_choice_msg
,
''
)
...
...
rest_framework/tests/test_serializer.py
View file @
8f79caf9
...
@@ -1385,7 +1385,7 @@ class ManyFieldHelpTextTest(TestCase):
...
@@ -1385,7 +1385,7 @@ class ManyFieldHelpTextTest(TestCase):
message that Django appends to choice fields.
message that Django appends to choice fields.
"""
"""
rel_field
=
fields
.
Field
(
help_text
=
ManyToManyModel
.
_meta
.
get_field
(
'rel'
)
.
help_text
)
rel_field
=
fields
.
Field
(
help_text
=
ManyToManyModel
.
_meta
.
get_field
(
'rel'
)
.
help_text
)
self
.
assertEqual
(
'Some help text.'
,
unicode
(
rel_field
.
help_text
)
)
self
.
assertEqual
(
'Some help text.'
,
rel_field
.
help_text
)
class
AttributeMappingOnAutogeneratedFieldsTests
(
TestCase
):
class
AttributeMappingOnAutogeneratedFieldsTests
(
TestCase
):
...
...
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