From d8dbd8679080035de4e785a8e7b998fb01f4052b Mon Sep 17 00:00:00 2001 From: Xavier Ordoquy Date: Sat, 10 Jan 2015 10:41:12 +0100 Subject: Update documentation --- api-guide/fields/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'api-guide/fields') diff --git a/api-guide/fields/index.html b/api-guide/fields/index.html index aedc4ea1..9cac530a 100644 --- a/api-guide/fields/index.html +++ b/api-guide/fields/index.html @@ -595,6 +595,7 @@

required

Normally an error will be raised if a field is not supplied during deserialization. Set to false if this field is not required to be present during deserialization.

+

Setting this to False also allows the object attribute or dictionary key to be omitted from output when serializing the instance. If the key is not present it will simply not be included in the output representation.

Defaults to True.

allow_null

Normally an error will be raised if None is passed to a serializer field. Set this keyword argument to True if None should be considered a valid value.

@@ -879,7 +880,7 @@ class UserSerializer(serializers.ModelSerializer): class ColorField(serializers.Field): """ - Color objects are serialized into "rgb(#, #, #)" notation. + Color objects are serialized into 'rgb(#, #, #)' notation. """ def to_representation(self, obj): return "rgb(%d, %d, %d)" % (obj.red, obj.green, obj.blue) -- cgit v1.2.3