The `exclude` option is no longer available. You should use the more explicit `fields` option instead.
The `exclude` option on `ModelSerializer`is no longer available. You should use the more explicit `fields` option instead.
#### The `extra_kwargs` option.
The `read_only_fields` and `write_only_fields` options have been removed and replaced with a more generic `extra_kwargs`.
The `read_only_fields` and `write_only_fields` options on `ModelSerializer`have been removed and replaced with a more generic `extra_kwargs`.
class MySerializer(serializer.ModelSerializer):
class Meta:
...
...
@@ -177,7 +204,7 @@ Alternatively, specify the field explicitly on the serializer class:
#### Fields for model methods and properties.
You can now specify field names in the `fields` option that refer to model methods or properties. For example, suppose you have the following model:
With `ModelSerilizer` you can now specify field names in the `fields` option that refer to model methods or properties. For example, suppose you have the following model: