* fix: Make the instance variable of child serializer point to the correct list object instead of the entire list when validating ListSerializer
* fix formatting issues for list serializer validation fix
* fix imports sorting for list serializer tests
* remove django 2.2 from docs index (#8982)
* Declared Django 4.2 support in README.md (#8985)
* Fix Links in Documentation to Django `reverse` and `reverse_lazy` (#8986)
* Fix Django Docs url in reverse.md
Django URLs of the documentation of `reverse` and `reverse_lazy` were wrong.
* Update reverse.md
* fix URLPathVersioning reverse fallback (#7247)
* fix URLPathVersioning reverse fallback
* add test for URLPathVersioning reverse fallback
* Update tests/test_versioning.py
---------
Co-authored-by: Jorn van Wier <jorn.van.wier@thunderbyte.ai>
Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
* Make set_value a method within `Serializer` (#8001)
* Make set_value a static method for Serializers
As an alternative to #7671, let the method be overridden if needed. As
the function is only used for serializers, it has a better place in the
Serializer class.
* Set `set_value` as an object (non-static) method
* Add tests for set_value()
These tests follow the examples given in the method.
* fix: Make the instance variable of child serializer point to the correct list object instead of the entire list when validating ListSerializer
* Make set_value a method within `Serializer` (#8001)
* Make set_value a static method for Serializers
As an alternative to #7671, let the method be overridden if needed. As
the function is only used for serializers, it has a better place in the
Serializer class.
* Set `set_value` as an object (non-static) method
* Add tests for set_value()
These tests follow the examples given in the method.
* fix: Make the instance variable of child serializer point to the correct list object instead of the entire list when validating ListSerializer
* fix: Make the instance variable of child serializer point to the correct list object instead of the entire list when validating ListSerializer
* fix formatting issues for list serializer validation fix
* fix: Make the instance variable of child serializer point to the correct list object instead of the entire list when validating ListSerializer
* fix formatting issues for list serializer validation fix
* fix linting
* Update rest_framework/serializers.py
Co-authored-by: Sergei Shishov <sshishov@users.noreply.github.com>
* Update rest_framework/serializers.py
Co-authored-by: Sergei Shishov <sshishov@users.noreply.github.com>
* fix: instance variable in list serializer, remove commented code
---------
Co-authored-by: Mathieu Dupuy <deronnax@gmail.com>
Co-authored-by: Mehraz Hossain Rumman <59512321+MehrazRumman@users.noreply.github.com>
Co-authored-by: Dominik Bruhn <dominik@dbruhn.de>
Co-authored-by: jornvanwier <mail@jornvanwier.com>
Co-authored-by: Jorn van Wier <jorn.van.wier@thunderbyte.ai>
Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Étienne Beaulé <beauleetienne0@gmail.com>
Co-authored-by: Sergei Shishov <sshishov@users.noreply.github.com>
* Make set_value a static method for Serializers
As an alternative to #7671, let the method be overridden if needed. As
the function is only used for serializers, it has a better place in the
Serializer class.
* Set `set_value` as an object (non-static) method
* Add tests for set_value()
These tests follow the examples given in the method.
* Expand declared filtering tests
- Test declared filter ordering
- Test multiple inheritance
* Fix serializer multiple inheritance bug
* Improve field order test to check for field types
Thanks to Jon Dufresne (@jdufresne) for review.
Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Co-authored-by: Rizwan Mansuri <Rizwan@webbyfox.com>
* Revert "Non-required fields with 'allow_null=True' should not imply a default value (#5639)"
This reverts commit 905a5579df.
Closes#5708
* Add test for allow_null + required=False
Ref #5708: allow_null should imply default=None, even for non-required fields.
* Re-order allow_null and default in field docs
default is prior to allow_null. allow_null implies an outgoing default=None.
* Adjust allow_null note.
* Always exclude read_only fields from _writable_fields
* Remove `read_only` from `CreateOnlyDefault` example.
In this context (without mentioning `save`) now slightly misleading.
* Add regression test for #2505. Thanks @pySilver!
* Add regression test for #5087
* Revert "Cached the field's root and context property."
This reverts commit 792005806b.
* Add test for disabling declared fields on child
* Check that declared base field is not in attrs
* Update meta inheritance docs to include serializer
* Test that meta fields cannot be declared as None
* Add docs example for declarative field disabling