Skip to content

Commit 9b4d5fe

Browse files
committed
Add release notes for #5886
1 parent 96f0404 commit 9b4d5fe

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/topics/release-notes.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,19 @@ You can determine your currently installed version using `pip show`:
4343
### 3.8.0
4444

4545
**Date**: [unreleased][3.8.0-milestone]
46+
* **Breaking Change**: Alter `read_only` plus `default` behaviour. [#5886][gh5886]
4647

48+
`read_only` fields will now **always** be excluded from writable fields.
49+
50+
Previously `read_only` fields with a `default` value would use the `default` for create and update operations.
51+
52+
In order to maintain the old behaviour you may need to pass the value of `read_only` fields when calling `save()` in
53+
the view:
54+
55+
def perform_create(self, serializer):
56+
serializer.save(owner=self.request.user)
57+
58+
Alternatively you may override `save()` or `create()` or `update()` on the serialiser as appropriate.
4759
* Refactor dynamic route generation and improve viewset action introspectibility. [#5705][gh5705]
4860

4961
`ViewSet`s have been provided with new attributes and methods that allow
@@ -1807,6 +1819,7 @@ For older release notes, [please see the version 2.x documentation][old-release-
18071819
[gh5697]: https://github.com/encode/django-rest-framework/issues/5697
18081820

18091821
<!-- 3.8.0 -->
1822+
[gh5886]: https://github.com/encode/django-rest-framework/issues/5886
18101823
[gh5705]: https://github.com/encode/django-rest-framework/issues/5705
18111824
[gh5796]: https://github.com/encode/django-rest-framework/issues/5796
18121825
[gh5763]: https://github.com/encode/django-rest-framework/issues/5763

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy