diff options
Diffstat (limited to 'docs/api-guide/fields.md')
| -rw-r--r-- | docs/api-guide/fields.md | 4 | 
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/api-guide/fields.md b/docs/api-guide/fields.md index f06db56c..b3d274dd 100644 --- a/docs/api-guide/fields.md +++ b/docs/api-guide/fields.md @@ -41,6 +41,8 @@ Defaults to `False`  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` @@ -480,7 +482,7 @@ Let's look at an example of serializing a class that represents an RGB color val      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)  | 
