mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-16 19:41:06 +03:00
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:
parent
680ed8aa8b
commit
be5a9f78f3
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user