From eddc34f4c81e1a0d188356c0d3d81f482a37f367 Mon Sep 17 00:00:00 2001 From: Ian Clark Date: Wed, 4 Jan 2017 08:40:42 +0000 Subject: [PATCH] Add Serializer Extensions documentation (#4777) --- docs/api-guide/serializers.md | 8 ++++++++ docs/topics/third-party-resources.md | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md index dd4ea8a90..b5aa78875 100644 --- a/docs/api-guide/serializers.md +++ b/docs/api-guide/serializers.md @@ -1140,6 +1140,13 @@ The [drf-dynamic-fields][drf-dynamic-fields] package provides a mixin to dynamic The [drf-flex-fields][drf-flex-fields] package extends the ModelSerializer and ModelViewSet to provide commonly used functionality for dynamically setting fields and expanding primitive fields to nested models, both from URL parameters and your serializer class definitions. +## Serializer Extensions + +The [django-rest-framework-serializer-extensions][drf-serializer-extensions] +package provides a collection of tools to DRY up your serializers, by allowing +fields to be defined on a per-view/request basis. Fields can be whitelisted, +blacklisted and child serializers can be optionally expanded. + ## HTML JSON Forms The [html-json-forms][html-json-forms] package provides an algorithm and serializer for processing `
` submissions per the (inactive) [HTML JSON Form specification][json-form-spec]. The serializer facilitates processing of arbitrarily nested JSON structures within HTML. For example, `` will be interpreted as `{"items": [{"id": "5"}]}`. @@ -1165,3 +1172,4 @@ The [html-json-forms][html-json-forms] package provides an algorithm and seriali [json-form-spec]: https://www.w3.org/TR/html-json-forms/ [drf-dynamic-fields]: https://github.com/dbrgn/drf-dynamic-fields [drf-base64]: https://bitbucket.org/levit_scs/drf_base64 +[drf-serializer-extensions]: https://github.com/evenicoulddoit/django-rest-framework-serializer-extensions diff --git a/docs/topics/third-party-resources.md b/docs/topics/third-party-resources.md index 96dfed602..462bd922a 100644 --- a/docs/topics/third-party-resources.md +++ b/docs/topics/third-party-resources.md @@ -204,7 +204,9 @@ To submit new content, [open an issue][drf-create-issue] or [create a pull reque * [djangorestframework-gis][djangorestframework-gis] - Geographic add-ons * [djangorestframework-hstore][djangorestframework-hstore] - Serializer class to support django-hstore DictionaryField model field and its schema-mode feature. * [djangorestframework-jsonapi][djangorestframework-jsonapi] - Provides a parser, renderer, serializers, and other tools to help build an API that is compliant with the jsonapi.org spec. -* [html-json-forms][html-json-forms]: Provides an algorithm and serializer to process HTML JSON Form submissions per the (inactive) spec. +* [html-json-forms][html-json-forms] - Provides an algorithm and serializer to process HTML JSON Form submissions per the (inactive) spec. +* [django-rest-framework-serializer-extensions][drf-serializer-extensions] - + Enables black/whitelisting fields, and conditionally expanding child serializers on a per-view/request basis. ### Serializer fields @@ -367,3 +369,4 @@ To submit new content, [open an issue][drf-create-issue] or [create a pull reque [django-rest-framework-course]: https://teamtreehouse.com/library/django-rest-framework [drf_tweaks]: https://github.com/ArabellaTech/drf_tweaks [drf-oidc-auth]: https://github.com/ByteInternet/drf-oidc-auth +[drf-serializer-extensions]: https://github.com/evenicoulddoit/django-rest-framework-serializer-extensions