From 182313cbee83d36765e8f5cbc24bef535c4ef190 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Tue, 9 Dec 2014 19:53:42 +0000 Subject: Update documentation --- api-guide/fields/index.html | 4 ++++ tutorial/5-relationships-and-hyperlinked-apis/index.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/api-guide/fields/index.html b/api-guide/fields/index.html index 46fa5f68..2610e178 100644 --- a/api-guide/fields/index.html +++ b/api-guide/fields/index.html @@ -753,13 +753,17 @@ color_channel = serializers.ChoiceField(
Signature: ChoiceField(choices)
choices - A list of valid values, or a list of (key, display_name) tuples.allow_blank - If set to True then the empty string should be considered a valid value. If set to False then the empty string is considered invalid and will raise a validation error. Defaults to False.Both the allow_blank and allow_null are valid options on ChoiceField, although it is highly recommended that you only use one and not both. allow_blank should be preferred for textual choices, and allow_null should be preferred for numeric or other non-textual choices.
A field that can accept a set of zero, one or many values, chosen from a limited set of choices. Takes a single mandatory argument. to_internal_representation returns a set containing the selected values.
Signature: MultipleChoiceField(choices)
choices - A list of valid values, or a list of (key, display_name) tuples.allow_blank - If set to True then the empty string should be considered a valid value. If set to False then the empty string is considered invalid and will raise a validation error. Defaults to False.As with ChoiceField, both the allow_blank and allow_null options are valid, although it is highly recommended that you only use one and not both. allow_blank should be preferred for textual choices, and allow_null should be preferred for numeric or other non-textual choices.
snippets/urls.py:
 
 
 class UserSerializer(serializers.HyperlinkedModelSerializer):
-    snippets = serializers.HyperlinkedRelatedField(many=True, view_name='snippet-detail')
+    snippets = serializers.HyperlinkedRelatedField(many=True, view_name='snippet-detail', read_only=True)
 
     class Meta:
         model = User
-- 
cgit v1.2.3