Skip to content

Commit 0b0c862

Browse files
committed
Add release notes for #5886
1 parent e7818bd commit 0b0c862

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)