Package: django-rest-framework-braces
Collection of utilities for working with DRF. Name inspired bydjango-braces.Free software: MIT licenseGitHub:https://github.com/dealertrack/django-rest-framework-bracesDocumentation:https://django-rest-framework-braces.readthedocs.io.InstallingEasiest way to installdjango-rest-framework-bracesis by usingpip:$ pip install django-rest-framework-bracesUsageOnce installed, you can use any of the supplied utilities by simply importing them.
For example:from drf_braces.mixins import MultipleSerializersViewMixin

class MyViewSet(MultipleSerializersViewMixin, GenericViewSet):
    def create(self, request):
        serializer = self.get_serializer(serializer_class=MySerializer)
        ...For full list of available utilities, please refer to thedocumentation.TestingTo run the tests you need to install testing requirements first:$ make installThen to run tests, you can use use Makefile command:$ make testHistory0.3.4 (2019-02-25)AddedEnforceValidationFieldMixin.capture_failed_field,FormSerializerFieldMixin.capture_failed_field,
andFormSerializerBase.capture_failed_fieldsto capture the optional fields that failed.0.3.3 (2019-02-21)Fixing invalid data being copied over inFormSerializerwhen fail mode is notfail0.3.2 (2018-11-21)FixingDoubleAsStrJsonEncoderby subclassing from DRF which supports datetimes, etc0.3.1 (2018-11-07)FixingSwappingSerializerMixinby supportingListSerializer0.3.0 (2018-11-05)AddedSwappingSerializerMixin.
Allows to declaratively swap fields any field instances in child serializers.AddedDoubleAsStrJsonEncoderfor handicapped API clients.0.2.3 (2017-10-18)Fixed how choices are normalized inSerializerFormto[(key, key)]vs previously[(key, value)]to match DRF’s handling of choices unlike Django forms.Added support forForm.all_fieldsandForm.all_base_fieldsinSerializerFormwhich supports custom form classes which implement such API.Added support forFormSerializer.Meta.excludewhich allows to specify fields to exclude.0.2.2 (2017-05-09)Addedroundingparameter toRoundedDecimalFieldwhich allows to define rounding direction
when rounding value.0.2.1 (2017-04-27)Fixed bugs inRoundedDecimalField0.2.0 (2017-04-25)AddedRoundedDecimalFieldfor rounding off decimal to specifieddecimal_placesinstead of validing that higher precision is not allowedAddedURLFieldfor automatic mapping between django forms and DRF serializers0.1.6 (2016-02-29)Fixed a bug inSerializerFormin which form cleaned data was replaced with serializer data
instead of updating it.0.1.5 (2015-07-15)Fixed a bug inEnforceValidationFieldMixinthat it was overwritingto_internal_valueinstead ofrun_validation0.1.4 (2015-07-13)Test coverage is now at 100%!0.1.3 (2015-07-10)Fixed bugs inAllowBlankNullFieldMixinAll DRF fields not subclass bothAllowBlankNullFieldMixinandEmptyStringFieldMixin0.1.2 (2015-07-02)Added customto_representation()toEmptyStringFieldMixinwhich allows to pass empty string orNonevalues.
This is especially useful for fields likeIntegerFieldwhich would blow up when passing empty string value for non-required fields.0.1.1 (2015-06-25)Fixed a bug inFormSerializerwhich did not honorfield_mappingin any of the subclasses0.1.0 (2015-06-15)First release on PyPI.CreditsDevelopment LeadMike Waters -https://github.com/mikewatersMiroslav Shubernetskiy -https://github.com/miki725ContributorsKhaled Porlin -https://github.com/porlin72Agam Dua -https://github.com/agamduaMarc Marta -https://github.com/mmartaClairePhila -https://github.com/ClairePhilaNdubisi Onuora -https://github.com/NdubisiOnuoraLicenseThe MIT License (MIT)

Copyright (c) 2015, dealertrack technologies

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.