Skip to content

Commit 2843b92

Browse files
denisSurkovauvipy
andauthored
Add note for HiddenField behavior (#9055)
* Add note for HiddenField behavior * Update docs/api-guide/fields.md * Update docs/api-guide/validators.md --------- Co-authored-by: Asif Saif Uddin <[email protected]>
1 parent a2430a8 commit 2843b92

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs/api-guide/fields.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,12 @@ The `HiddenField` class is usually only needed if you have some validation that
558558

559559
For further examples on `HiddenField` see the [validators](validators.md) documentation.
560560

561+
---
562+
563+
**Note:** `HiddenField()` does not appear in `partial=True` serializer (when making `PATCH` request). This behavior might change in future, follow updates on [github discussion](https://github.com/encode/django-rest-framework/discussions/8259).
564+
565+
---
566+
561567
## ModelField
562568

563569
A generic field that can be tied to any arbitrary model field. The `ModelField` class delegates the task of serialization/deserialization to its associated model field. This field can be used to create serializer fields for custom model fields, without having to create a new custom serializer field.

docs/api-guide/validators.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ If you want the date field to be entirely hidden from the user, then use `Hidden
164164

165165
---
166166

167+
---
168+
169+
**Note:** `HiddenField()` does not appear in `partial=True` serializer (when making `PATCH` request). This behavior might change in future, follow updates on [github discussion](https://github.com/encode/django-rest-framework/discussions/8259).
170+
171+
---
172+
167173
# Advanced field defaults
168174

169175
Validators that are applied across multiple fields in the serializer can sometimes require a field input that should not be provided by the API client, but that *is* available as input to the validator.

0 commit comments

Comments
 (0)