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
bd8098e3
Commit
bd8098e3
authored
Nov 30, 2015
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix template typo.
Closes #3682. Thanks for the report!
parent
68285a9b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
docs/topics/html-and-forms.md
+8
-4
No files found.
docs/topics/html-and-forms.md
View file @
bd8098e3
...
...
@@ -68,7 +68,8 @@ The following view demonstrates an example of using a serializer in a template f
profile = get_object_or_404(Profile, pk=pk)
serializer = ProfileSerializer(profile)
if not serializer.is_valid():
return Response({'serializer': serializer, 'profile': profile}) return redirect('profile-list')
return Response({'serializer': serializer, 'profile': profile})
return redirect('profile-list')
**profile_detail.html**
:
...
...
@@ -78,7 +79,7 @@ The following view demonstrates an example of using a serializer in a template f
<h1>
Profile - {{ profile.name }}
</h1>
<form action="{% url 'profile-detail' pk=profile.pk
'%}" method="POST">
<form
action=
"{% url 'profile-detail' pk=profile.pk
%}"
method=
"POST"
>
{% csrf_token %}
{% render_form serializer %}
<input
type=
"submit"
value=
"Save"
>
...
...
@@ -112,7 +113,9 @@ Let's take a look at how to render each of the three available template packs. F
max_length=100,
style={'input_type': 'password', 'placeholder': 'Password'}
)
remember_me = serializers.BooleanField() ---
remember_me = serializers.BooleanField()
---
#### `rest_framework/vertical`
...
...
@@ -133,7 +136,8 @@ Presents form labels above their corresponding control inputs, using the standar

---
####
`rest_framework/horizontal`
#### `rest_framework/horizontal`
Presents labels and controls alongside each other, using a 2/10 column split.
...
...
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