mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-10-31 07:57:55 +03:00 
			
		
		
		
	Merge pull request #2497 from jpadilla/master
Fix base_template examples
This commit is contained in:
		
						commit
						d6153a7fae
					
				|  | @ -826,7 +826,7 @@ The `style` keyword argument can be used to pass through additional information | ||||||
| For example, to use a `textarea` control instead of the default `input` control, you would use the following… | For example, to use a `textarea` control instead of the default `input` control, you would use the following… | ||||||
| 
 | 
 | ||||||
|     additional_notes = serializers.CharField( |     additional_notes = serializers.CharField( | ||||||
|         style={'base_template': 'text_area.html'} |         style={'base_template': 'textarea.html'} | ||||||
|     ) |     ) | ||||||
| 
 | 
 | ||||||
| Similarly, to use a radio button control instead of the default `select` control, you would use the following… | Similarly, to use a radio button control instead of the default `select` control, you would use the following… | ||||||
|  |  | ||||||
|  | @ -97,7 +97,7 @@ The first thing we need to get started on our Web API is to provide a way of ser | ||||||
|     class SnippetSerializer(serializers.Serializer): |     class SnippetSerializer(serializers.Serializer): | ||||||
|         pk = serializers.IntegerField(read_only=True) |         pk = serializers.IntegerField(read_only=True) | ||||||
|         title = serializers.CharField(required=False, allow_blank=True, max_length=100) |         title = serializers.CharField(required=False, allow_blank=True, max_length=100) | ||||||
|         code = serializers.CharField(style={'type': 'textarea'}) |         code = serializers.CharField(style={'base_template': 'textarea.html'}) | ||||||
|         linenos = serializers.BooleanField(required=False) |         linenos = serializers.BooleanField(required=False) | ||||||
|         language = serializers.ChoiceField(choices=LANGUAGE_CHOICES, default='python') |         language = serializers.ChoiceField(choices=LANGUAGE_CHOICES, default='python') | ||||||
|         style = serializers.ChoiceField(choices=STYLE_CHOICES, default='friendly') |         style = serializers.ChoiceField(choices=STYLE_CHOICES, default='friendly') | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user