Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
d6153a7f
Commit
d6153a7f
authored
Feb 01, 2015
by
José Padilla
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2497 from jpadilla/master
Fix base_template examples
parents
a89e05dc
9437d9b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
docs/topics/3.0-announcement.md
+1
-1
docs/tutorial/1-serialization.md
+1
-1
No files found.
docs/topics/3.0-announcement.md
View file @
d6153a7f
...
@@ -826,7 +826,7 @@ The `style` keyword argument can be used to pass through additional information
...
@@ -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…
...
...
docs/tutorial/1-serialization.md
View file @
d6153a7f
...
@@ -97,7 +97,7 @@ The first thing we need to get started on our Web API is to provide a way of ser
...
@@ -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')
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment