mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
Merge f20613a828
into 1e9e1a5bfe
This commit is contained in:
commit
d671371527
|
@ -415,6 +415,15 @@ class HyperlinkedIdentityField(HyperlinkedRelatedField):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
class HyperlinkedPrimaryKeyRelatedField(HyperlinkedRelatedField):
|
||||||
|
"""
|
||||||
|
A read-write field which act like HyperlinkedRelatedField in output and
|
||||||
|
act like PrimaryKeyRelatedField in input
|
||||||
|
"""
|
||||||
|
def to_internal_value(self, data):
|
||||||
|
return self.get_queryset().get(pk=data)
|
||||||
|
|
||||||
|
|
||||||
class SlugRelatedField(RelatedField):
|
class SlugRelatedField(RelatedField):
|
||||||
"""
|
"""
|
||||||
A read-write field that represents the target of the relationship
|
A read-write field that represents the target of the relationship
|
||||||
|
|
Loading…
Reference in New Issue
Block a user