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
c630a12e
Commit
c630a12e
authored
Oct 01, 2014
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deal with lazy strings in serializer reprs
parent
38177173
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
rest_framework/utils/representation.py
+5
-0
No files found.
rest_framework/utils/representation.py
View file @
c630a12e
...
@@ -3,6 +3,8 @@ Helper functions for creating user-friendly representations
...
@@ -3,6 +3,8 @@ Helper functions for creating user-friendly representations
of serializer classes and serializer fields.
of serializer classes and serializer fields.
"""
"""
from
django.db
import
models
from
django.db
import
models
from
django.utils.functional
import
Promise
from
rest_framework.compat
import
force_text
import
re
import
re
...
@@ -19,6 +21,9 @@ def smart_repr(value):
...
@@ -19,6 +21,9 @@ def smart_repr(value):
if
isinstance
(
value
,
models
.
Manager
):
if
isinstance
(
value
,
models
.
Manager
):
return
manager_repr
(
value
)
return
manager_repr
(
value
)
if
isinstance
(
value
,
Promise
)
and
value
.
_delegate_text
:
value
=
force_text
(
value
)
value
=
repr
(
value
)
value
=
repr
(
value
)
# Representations like u'help text'
# Representations like u'help text'
...
...
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