mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
commit
e7eccac6df
|
@ -488,7 +488,7 @@ This field is used by default with `ModelSerializer` when including field names
|
||||||
|
|
||||||
**Signature**: `ReadOnlyField()`
|
**Signature**: `ReadOnlyField()`
|
||||||
|
|
||||||
For example, is `has_expired` was a property on the `Account` model, then the following serializer would automatically generate it as a `ReadOnlyField`:
|
For example, if `has_expired` was a property on the `Account` model, then the following serializer would automatically generate it as a `ReadOnlyField`:
|
||||||
|
|
||||||
class AccountSerializer(serializers.ModelSerializer):
|
class AccountSerializer(serializers.ModelSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user