aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2013-01-29 09:15:08 +0000
committerTom Christie2013-01-29 09:15:16 +0000
commit1929159db1b45ef28d1f7fdf0bea9d0867af13f3 (patch)
tree3ff1d7c0ba3a4a6e2245911250c2ad8fc8f9e4ee
parent5f065153c31b586ca058deb8f6bd48303e3628e5 (diff)
downloaddjango-rest-framework-1929159db1b45ef28d1f7fdf0bea9d0867af13f3.tar.bz2
Docs tweaks.
-rw-r--r--docs/api-guide/fields.md4
-rw-r--r--docs/api-guide/serializers.md12
2 files changed, 6 insertions, 10 deletions
diff --git a/docs/api-guide/fields.md b/docs/api-guide/fields.md
index e43282ce..3f8a36e2 100644
--- a/docs/api-guide/fields.md
+++ b/docs/api-guide/fields.md
@@ -240,7 +240,9 @@ Signature and validation is the same as with `FileField`.
---
**Note:** `FileFields` and `ImageFields` are only suitable for use with MultiPartParser, since e.g. json doesn't support file uploads.
-Django's regular [FILE_UPLOAD_HANDLERS] are used for handling uploaded files.
+Django's regular [FILE_UPLOAD_HANDLERS] are used for handling uploaded files.
+
+---
[cite]: https://docs.djangoproject.com/en/dev/ref/forms/api/#django.forms.Form.cleaned_data
[FILE_UPLOAD_HANDLERS]: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-FILE_UPLOAD_HANDLERS
diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md
index d98a602f..487502e9 100644
--- a/docs/api-guide/serializers.md
+++ b/docs/api-guide/serializers.md
@@ -190,18 +190,12 @@ By default field values are treated as mapping to an attribute on the object. I
As an example, let's create a field that can be used represent the class name of the object being serialized:
- class ClassNameField(serializers.WritableField):
+ class ClassNameField(serializers.Field):
def field_to_native(self, obj, field_name):
"""
- Serialize the object's class name, not an attribute of the object.
+ Serialize the object's class name.
"""
- return obj.__class__.__name__
-
- def field_from_native(self, data, field_name, into):
- """
- We don't want to set anything when we revert this field.
- """
- pass
+ return obj.__class__
---