mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-16 19:41:06 +03:00
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 <auvipy@gmail.com>
This commit is contained in:
parent
a2430a8cce
commit
2843b925f9
|
@ -558,6 +558,12 @@ The `HiddenField` class is usually only needed if you have some validation that
|
||||||
|
|
||||||
For further examples on `HiddenField` see the [validators](validators.md) documentation.
|
For further examples on `HiddenField` see the [validators](validators.md) documentation.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**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).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## ModelField
|
## ModelField
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
|
@ -164,6 +164,12 @@ If you want the date field to be entirely hidden from the user, then use `Hidden
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**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).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
# Advanced field defaults
|
# Advanced field defaults
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user