mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 21:10:13 +03:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
9abbfa1f60
|
@ -1157,6 +1157,9 @@ The [html-json-forms][html-json-forms] package provides an algorithm and seriali
|
||||||
|
|
||||||
[djangorestframework-queryfields][djangorestframework-queryfields] allows API clients to specify which fields will be sent in the response via inclusion/exclusion query parameters.
|
[djangorestframework-queryfields][djangorestframework-queryfields] allows API clients to specify which fields will be sent in the response via inclusion/exclusion query parameters.
|
||||||
|
|
||||||
|
## DRF Writable Nested
|
||||||
|
|
||||||
|
The [drf-writable-nested][drf-writable-nested] package provides writable nested model serializer which allows to create/update models with nested related data.
|
||||||
|
|
||||||
[cite]: https://groups.google.com/d/topic/django-users/sVFaOfQi4wY/discussion
|
[cite]: https://groups.google.com/d/topic/django-users/sVFaOfQi4wY/discussion
|
||||||
[relations]: relations.md
|
[relations]: relations.md
|
||||||
|
@ -1177,3 +1180,4 @@ The [html-json-forms][html-json-forms] package provides an algorithm and seriali
|
||||||
[drf-base64]: https://bitbucket.org/levit_scs/drf_base64
|
[drf-base64]: https://bitbucket.org/levit_scs/drf_base64
|
||||||
[drf-serializer-extensions]: https://github.com/evenicoulddoit/django-rest-framework-serializer-extensions
|
[drf-serializer-extensions]: https://github.com/evenicoulddoit/django-rest-framework-serializer-extensions
|
||||||
[djangorestframework-queryfields]: http://djangorestframework-queryfields.readthedocs.io/
|
[djangorestframework-queryfields]: http://djangorestframework-queryfields.readthedocs.io/
|
||||||
|
[drf-writable-nested]: http://github.com/Brogency/drf-writable-nested
|
||||||
|
|
|
@ -1446,11 +1446,11 @@ class FileField(Field):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def to_representation(self, value):
|
def to_representation(self, value):
|
||||||
use_url = getattr(self, 'use_url', api_settings.UPLOADED_FILES_USE_URL)
|
|
||||||
|
|
||||||
if not value:
|
if not value:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
use_url = getattr(self, 'use_url', api_settings.UPLOADED_FILES_USE_URL)
|
||||||
|
|
||||||
if use_url:
|
if use_url:
|
||||||
if not getattr(value, 'url', None):
|
if not getattr(value, 'url', None):
|
||||||
# If the file has not been saved it may not have a URL.
|
# If the file has not been saved it may not have a URL.
|
||||||
|
|
|
@ -353,10 +353,9 @@ class Request(object):
|
||||||
|
|
||||||
def _not_authenticated(self):
|
def _not_authenticated(self):
|
||||||
"""
|
"""
|
||||||
Return a three-tuple of (authenticator, user, authtoken), representing
|
Set authenticator, user & authtoken representing an unauthenticated request.
|
||||||
an unauthenticated request.
|
|
||||||
|
|
||||||
By default this will be (None, AnonymousUser, None).
|
Defaults are None, AnonymousUser & None.
|
||||||
"""
|
"""
|
||||||
self._authenticator = None
|
self._authenticator = None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user