diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 7d3ae6a6d5..1893a32c9a 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1565,7 +1565,7 @@ class ReadOnlyField(Field): For example, the following would call `get_expiry_date()` on the object: - class ExampleSerializer(self): + class ExampleSerializer(Serializer): expiry_date = ReadOnlyField(source='get_expiry_date') """