aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide/fields.md
diff options
context:
space:
mode:
authorMarko Tibold2012-11-16 00:22:08 +0100
committerMarko Tibold2012-11-16 00:22:08 +0100
commitb4cfb46a56c8f7d9bc4340d5443f3a2d57ba9b58 (patch)
tree41a39e2560b2feb5d2229ffa2a31595bbc392de6 /docs/api-guide/fields.md
parent403886b79b9bf5790ee6f07d6ca915cff5b3035a (diff)
downloaddjango-rest-framework-b4cfb46a56c8f7d9bc4340d5443f3a2d57ba9b58.tar.bz2
WIP on docs for File- and ImageFileds.
Diffstat (limited to 'docs/api-guide/fields.md')
-rw-r--r--docs/api-guide/fields.md32
1 files changed, 32 insertions, 0 deletions
diff --git a/docs/api-guide/fields.md b/docs/api-guide/fields.md
index 0485b158..0b25a6ef 100644
--- a/docs/api-guide/fields.md
+++ b/docs/api-guide/fields.md
@@ -165,6 +165,38 @@ A floating point representation.
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