diff --git a/docs/topics/3.8-announcement.md b/docs/topics/3.8-announcement.md index 7b137006da..857cdf8bc9 100644 --- a/docs/topics/3.8-announcement.md +++ b/docs/topics/3.8-announcement.md @@ -33,6 +33,28 @@ If you use REST framework commercially and would like to see this work continue, *We'd like to say thanks in particular our premium backers, [Rover](http://jobs.rover.com/), [Sentry](https://getsentry.com/welcome/), [Stream](https://getstream.io/?utm_source=drf&utm_medium=banner&utm_campaign=drf), [Machinalis](https://hello.machinalis.co.uk/), and [Rollbar](https://rollbar.com).* + +--- + +## Breaking Changes + +### Altered behaviour of `read_only` plus `default` on Field. + +[#5886][gh5886] + +`read_only` fields will now **always** be excluded from writable fields. + +Previously `read_only` fields with a `default` value would use the `default` for create and update operations. + +In order to maintain the old behaviour you may need to pass the value of `read_only` fields when calling `save()` in +the view: + + def perform_create(self, serializer): + serializer.save(owner=self.request.user) + +Alternatively you may override `save()` or `create()` or `update()` on the serialiser as appropriate. + + --- ## Boolean Composable Permissions @@ -72,3 +94,4 @@ TODO TODO [funding]: funding.md +[gh5886]: https://github.com/encode/django-rest-framework/issues/5886