Modelのフィールドに対応するフィールドを持つ[[Serializer (DRF)|Serializer]]。Modelと[[Serializer (DRF)|Serializer]]の定義が近しいときシンプルに実装できる。 [[Serializer (DRF)|Serializer]]との違いは以下3点。 - Modelの定義から[[属性 (Python)|属性]]を自動生成する - validatorを自動生成する - `create()` と `update()` のデフォルト実装を提供する > **The `ModelSerializer` class is the same as a regular `Serializer` class, except that**: > > - It will automatically generate a set of fields for you, based on the model. > - It will automatically generate validators for the serializer, such as unique_together validators. > - It includes simple default implementations of `.create()` and `.update()`. > > *[Serializers - Django REST framework](https://www.django-rest-framework.org/api-guide/serializers/#modelserializer)*