diff options
| author | Tom Christie | 2012-10-02 15:37:13 +0100 |
|---|---|---|
| committer | Tom Christie | 2012-10-02 15:37:13 +0100 |
| commit | ab173fd8f9070ccdb70f86f400d2ffa780977ce4 (patch) | |
| tree | 0c66097d32b47038fd92e020fc8665d7cc55e5d9 /docs/api-guide/serializers.md | |
| parent | e7685f3eb5c7d7e8fb1678d673f03688012b00cb (diff) | |
| download | django-rest-framework-ab173fd8f9070ccdb70f86f400d2ffa780977ce4.tar.bz2 | |
Fix bug where pk could be set in post data
Diffstat (limited to 'docs/api-guide/serializers.md')
| -rw-r--r-- | docs/api-guide/serializers.md | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md index 38a1e560..4ddc6e0a 100644 --- a/docs/api-guide/serializers.md +++ b/docs/api-guide/serializers.md @@ -230,6 +230,9 @@ The `nested` option may also be set by passing it to the `serialize()` method. class Meta: model = Account + def get_pk_field(self, model_field): + return Field(readonly=True) + def get_nested_field(self, model_field): return ModelSerializer() |
