Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Anna 2017-02-21 09:33:19 +01:00
commit 9abbfa1f60
3 changed files with 8 additions and 5 deletions

View File

@ -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.
## 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
[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-serializer-extensions]: https://github.com/evenicoulddoit/django-rest-framework-serializer-extensions
[djangorestframework-queryfields]: http://djangorestframework-queryfields.readthedocs.io/
[drf-writable-nested]: http://github.com/Brogency/drf-writable-nested

View File

@ -1446,11 +1446,11 @@ class FileField(Field):
return data
def to_representation(self, value):
use_url = getattr(self, 'use_url', api_settings.UPLOADED_FILES_USE_URL)
if not value:
return None
use_url = getattr(self, 'use_url', api_settings.UPLOADED_FILES_USE_URL)
if use_url:
if not getattr(value, 'url', None):
# If the file has not been saved it may not have a URL.

View File

@ -353,10 +353,9 @@ class Request(object):
def _not_authenticated(self):
"""
Return a three-tuple of (authenticator, user, authtoken), representing
an unauthenticated request.
Set authenticator, user & authtoken representing an unauthenticated request.
By default this will be (None, AnonymousUser, None).
Defaults are None, AnonymousUser & None.
"""
self._authenticator = None