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
dc52ceaa
Commit
dc52ceaa
authored
Oct 09, 2012
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Field handling relations/relationship managers - use RelatedField/ManyRelatedField instead
parent
5c17a601
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
5 deletions
+1
-5
rest_framework/fields.py
+0
-4
rest_framework/tests/genericrelations.py
+1
-1
No files found.
rest_framework/fields.py
View file @
dc52ceaa
...
@@ -83,10 +83,6 @@ class Field(object):
...
@@ -83,10 +83,6 @@ class Field(object):
if
is_protected_type
(
value
):
if
is_protected_type
(
value
):
return
value
return
value
all_callable
=
getattr
(
value
,
'all'
,
None
)
if
is_simple_callable
(
all_callable
):
return
[
self
.
to_native
(
item
)
for
item
in
value
.
all
()]
elif
hasattr
(
value
,
'__iter__'
)
and
not
isinstance
(
value
,
(
dict
,
basestring
)):
elif
hasattr
(
value
,
'__iter__'
)
and
not
isinstance
(
value
,
(
dict
,
basestring
)):
return
[
self
.
to_native
(
item
)
for
item
in
value
]
return
[
self
.
to_native
(
item
)
for
item
in
value
]
return
smart_unicode
(
value
)
return
smart_unicode
(
value
)
...
...
rest_framework/tests/genericrelations.py
View file @
dc52ceaa
...
@@ -19,7 +19,7 @@ class TestGenericRelations(TestCase):
...
@@ -19,7 +19,7 @@ class TestGenericRelations(TestCase):
def
test_reverse_generic_relation
(
self
):
def
test_reverse_generic_relation
(
self
):
class
BookmarkSerializer
(
serializers
.
ModelSerializer
):
class
BookmarkSerializer
(
serializers
.
ModelSerializer
):
tags
=
serializers
.
Field
(
source
=
'tags'
)
tags
=
serializers
.
ManyRelated
Field
(
source
=
'tags'
)
class
Meta
:
class
Meta
:
model
=
Bookmark
model
=
Bookmark
...
...
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