mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-17 03:51:03 +03:00
WIP on docs for File- and ImageFileds.
This commit is contained in:
parent
403886b79b
commit
b4cfb46a56
|
@ -165,6 +165,38 @@ A floating point representation.
|
||||||
|
|
||||||
Corresponds to `django.db.models.fields.FloatField`.
|
Corresponds to `django.db.models.fields.FloatField`.
|
||||||
|
|
||||||
|
## FileField
|
||||||
|
|
||||||
|
A file representation. Performs Django's standard FileField validation.
|
||||||
|
|
||||||
|
Corresponds to `django.forms.fields.FileField`.
|
||||||
|
|
||||||
|
### Optional arguments
|
||||||
|
|
||||||
|
#### `max_length`
|
||||||
|
|
||||||
|
Maximum length for the file name. This value is obtained from the model when used with a ModelSerializer.
|
||||||
|
|
||||||
|
Defaults to `None`, meaning validation is skipped.
|
||||||
|
|
||||||
|
#### `allow_empty_file`
|
||||||
|
|
||||||
|
Determines if empty file uploads are allowed.
|
||||||
|
|
||||||
|
Defaults to `False`
|
||||||
|
|
||||||
|
## ImageField
|
||||||
|
|
||||||
|
An image representation.
|
||||||
|
|
||||||
|
Corresponds to `django.forms.fields.ImageField`.
|
||||||
|
|
||||||
|
### Optional arguments
|
||||||
|
|
||||||
|
Same as FileField.
|
||||||
|
|
||||||
|
Requires the `PIL` package.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# Relational Fields
|
# Relational Fields
|
||||||
|
|
Loading…
Reference in New Issue
Block a user