Added note on serializing extra fields from Through Model (#6652)

* adding small clarification on ManyToManyFields with a Through Model

As pointed here: https://github.com/encode/django-rest-framework/pull/6585#issuecomment-490145334 I suggest to add the small clarification to work with **ManyToManyFields with a Through Model**.

* Remove blank line.
This commit is contained in:
Andreu Vallbona Plazas 2019-05-07 20:01:24 +02:00 committed by Carlton Gibson
parent 680ed8aa8b
commit be5a9f78f3

View File

@ -576,6 +576,8 @@ If you explicitly specify a relational field pointing to a
``ManyToManyField`` with a through model, be sure to set ``read_only``
to ``True``.
If you wish to represent [extra fields on a through model][django-intermediary-manytomany] then you may serialize the through model as [a nested object][dealing-with-nested-objects].
---
# Third Party Packages
@ -596,3 +598,5 @@ The [rest-framework-generic-relations][drf-nested-relations] library provides re
[generic-relations]: https://docs.djangoproject.com/en/stable/ref/contrib/contenttypes/#id1
[drf-nested-routers]: https://github.com/alanjds/drf-nested-routers
[drf-nested-relations]: https://github.com/Ian-Foote/rest-framework-generic-relations
[django-intermediary-manytomany]: https://docs.djangoproject.com/en/2.2/topics/db/models/#intermediary-manytomany
[dealing-with-nested-objects]: https://www.django-rest-framework.org/api-guide/serializers/#dealing-with-nested-objects