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
a0e852a4
Commit
a0e852a4
authored
Oct 09, 2014
by
Tom Christie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use BoundField .name on fields
parent
f83ed19d
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
20 additions
and
20 deletions
+20
-20
rest_framework/templates/rest_framework/fields/attrs.html
+1
-1
rest_framework/templates/rest_framework/fields/horizontal/checkbox.html
+1
-1
rest_framework/templates/rest_framework/fields/horizontal/select.html
+1
-1
rest_framework/templates/rest_framework/fields/horizontal/select_checkbox.html
+2
-2
rest_framework/templates/rest_framework/fields/horizontal/select_multiple.html
+1
-1
rest_framework/templates/rest_framework/fields/horizontal/select_radio.html
+2
-2
rest_framework/templates/rest_framework/fields/inline/checkbox.html
+1
-1
rest_framework/templates/rest_framework/fields/inline/select.html
+1
-1
rest_framework/templates/rest_framework/fields/inline/select_checkbox.html
+1
-1
rest_framework/templates/rest_framework/fields/inline/select_multiple.html
+1
-1
rest_framework/templates/rest_framework/fields/inline/select_radio.html
+1
-1
rest_framework/templates/rest_framework/fields/vertical/checkbox.html
+1
-1
rest_framework/templates/rest_framework/fields/vertical/select.html
+1
-1
rest_framework/templates/rest_framework/fields/vertical/select_checkbox.html
+2
-2
rest_framework/templates/rest_framework/fields/vertical/select_multiple.html
+1
-1
rest_framework/templates/rest_framework/fields/vertical/select_radio.html
+2
-2
No files found.
rest_framework/templates/rest_framework/fields/attrs.html
View file @
a0e852a4
name="{{ field.
field_
name }}" {% if field.style.placeholder %}placeholder="{{ field.style.placeholder }}"{% endif %} {% if field.style.rows %}rows="{{ field.style.rows }}"{% endif %}
name="{{ field.name }}" {% if field.style.placeholder %}placeholder="{{ field.style.placeholder }}"{% endif %} {% if field.style.rows %}rows="{{ field.style.rows }}"{% endif %}
rest_framework/templates/rest_framework/fields/horizontal/checkbox.html
View file @
a0e852a4
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<div
class=
"col-sm-offset-2 col-sm-10"
>
<div
class=
"col-sm-offset-2 col-sm-10"
>
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label>
<label>
<input
type=
"checkbox"
name=
"{{ field.
field_
name }}"
value=
"true"
{%
if
field
.
value
%}
checked
{%
endif
%}
>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"true"
{%
if
field
.
value
%}
checked
{%
endif
%}
>
{% if field.label %}{{ field.label }}{% endif %}
{% if field.label %}{{ field.label }}{% endif %}
</label>
</label>
</div>
</div>
...
...
rest_framework/templates/rest_framework/fields/horizontal/select.html
View file @
a0e852a4
<div
class=
"form-group"
>
<div
class=
"form-group"
>
{% include "rest_framework/fields/horizontal/label.html" %}
{% include "rest_framework/fields/horizontal/label.html" %}
<div
class=
"col-sm-10"
>
<div
class=
"col-sm-10"
>
<select
class=
"form-control"
name=
"{{ field.
field_
name }}"
>
<select
class=
"form-control"
name=
"{{ field.name }}"
>
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<option
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
<option
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% endfor %}
{% endfor %}
...
...
rest_framework/templates/rest_framework/fields/horizontal/select_checkbox.html
View file @
a0e852a4
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
{% if field.style.inline %}
{% if field.style.inline %}
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<label
class=
"checkbox-inline"
>
<label
class=
"checkbox-inline"
>
<input
type=
"checkbox"
name=
"{{ field.
field_
name }}"
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
checked
{%
endif
%}
>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
checked
{%
endif
%}
>
{{ text }}
{{ text }}
</label>
</label>
{% endfor %}
{% endfor %}
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label>
<label>
<input
type=
"checkbox"
name=
"{{ field.
field_
name }}"
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
checked
{%
endif
%}
>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
checked
{%
endif
%}
>
{{ text }}
{{ text }}
</label>
</label>
</div>
</div>
...
...
rest_framework/templates/rest_framework/fields/horizontal/select_multiple.html
View file @
a0e852a4
<div
class=
"form-group"
>
<div
class=
"form-group"
>
{% include "rest_framework/fields/horizontal/label.html" %}
{% include "rest_framework/fields/horizontal/label.html" %}
<div
class=
"col-sm-10"
>
<div
class=
"col-sm-10"
>
<select
multiple
class=
"form-control"
name=
"{{ field.
field_
name }}"
>
<select
multiple
class=
"form-control"
name=
"{{ field.name }}"
>
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<option
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
<option
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% endfor %}
{% endfor %}
...
...
rest_framework/templates/rest_framework/fields/horizontal/select_radio.html
View file @
a0e852a4
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
{% if field.style.inline %}
{% if field.style.inline %}
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<label
class=
"radio-inline"
>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"{{ field.
field_
name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
>
{{ text }}
{{ text }}
</label>
</label>
{% endfor %}
{% endfor %}
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<div
class=
"radio"
>
<div
class=
"radio"
>
<label>
<label>
<input
type=
"radio"
name=
"{{ field.
field_
name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
>
{{ text }}
{{ text }}
</label>
</label>
</div>
</div>
...
...
rest_framework/templates/rest_framework/fields/inline/checkbox.html
View file @
a0e852a4
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label>
<label>
<input
type=
"checkbox"
name=
"{{ field.
field_
name }}"
value=
"true"
{%
if
field
.
value
%}
checked
{%
endif
%}
>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"true"
{%
if
field
.
value
%}
checked
{%
endif
%}
>
{% if field.label %}{{ field.label }}{% endif %}
{% if field.label %}{{ field.label }}{% endif %}
</label>
</label>
</div>
</div>
rest_framework/templates/rest_framework/fields/inline/select.html
View file @
a0e852a4
<div
class=
"form-group"
>
<div
class=
"form-group"
>
{% include "rest_framework/fields/inline/label.html" %}
{% include "rest_framework/fields/inline/label.html" %}
<select
class=
"form-control"
name=
"{{ field.
field_
name }}"
>
<select
class=
"form-control"
name=
"{{ field.name }}"
>
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<option
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
<option
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% endfor %}
{% endfor %}
...
...
rest_framework/templates/rest_framework/fields/inline/select_checkbox.html
View file @
a0e852a4
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label>
<label>
<input
type=
"checkbox"
name=
"{{ rest_framework/field.
field_
name }}"
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
checked
{%
endif
%}
>
<input
type=
"checkbox"
name=
"{{ rest_framework/field.name }}"
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
checked
{%
endif
%}
>
{{ text }}
{{ text }}
</label>
</label>
</div>
</div>
...
...
rest_framework/templates/rest_framework/fields/inline/select_multiple.html
View file @
a0e852a4
<div
class=
"form-group"
>
<div
class=
"form-group"
>
{% include "rest_framework/fields/inline/label.html" %}
{% include "rest_framework/fields/inline/label.html" %}
<select
multiple
class=
"form-control"
name=
"{{ field.
field_
name }}"
>
<select
multiple
class=
"form-control"
name=
"{{ field.name }}"
>
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<option
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
<option
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% endfor %}
{% endfor %}
...
...
rest_framework/templates/rest_framework/fields/inline/select_radio.html
View file @
a0e852a4
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<div
class=
"radio"
>
<div
class=
"radio"
>
<label>
<label>
<input
type=
"radio"
name=
"{{ field.
field_
name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
>
{{ text }}
{{ text }}
</label>
</label>
</div>
</div>
...
...
rest_framework/templates/rest_framework/fields/vertical/checkbox.html
View file @
a0e852a4
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label>
<label>
<input
type=
"checkbox"
name=
"{{ field.
field_
name }}"
value=
"true"
{%
if
value
%}
checked
{%
endif
%}
>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"true"
{%
if
value
%}
checked
{%
endif
%}
>
{% if field.label %}{{ field.label }}{% endif %}
{% if field.label %}{{ field.label }}{% endif %}
</label>
</label>
</div>
</div>
rest_framework/templates/rest_framework/fields/vertical/select.html
View file @
a0e852a4
<div
class=
"form-group"
>
<div
class=
"form-group"
>
{% include "rest_framework/fields/vertical/label.html" %}
{% include "rest_framework/fields/vertical/label.html" %}
<select
class=
"form-control"
name=
"{{ field.
field_
name }}"
>
<select
class=
"form-control"
name=
"{{ field.name }}"
>
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<option
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
<option
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% endfor %}
{% endfor %}
...
...
rest_framework/templates/rest_framework/fields/vertical/select_checkbox.html
View file @
a0e852a4
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div>
<div>
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<label
class=
"checkbox-inline"
>
<label
class=
"checkbox-inline"
>
<input
type=
"checkbox"
name=
"{{ field.
field_
name }}"
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
checked
{%
endif
%}
>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
checked
{%
endif
%}
>
{{ text }}
{{ text }}
</label>
</label>
{% endfor %}
{% endfor %}
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<div
class=
"checkbox"
>
<div
class=
"checkbox"
>
<label>
<label>
<input
type=
"checkbox"
name=
"{{ field.
field_
name }}"
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
checked
{%
endif
%}
>
<input
type=
"checkbox"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
checked
{%
endif
%}
>
{{ text }}
{{ text }}
</label>
</label>
</div>
</div>
...
...
rest_framework/templates/rest_framework/fields/vertical/select_multiple.html
View file @
a0e852a4
<div
class=
"form-group"
>
<div
class=
"form-group"
>
{% include "rest_framework/fields/vertical/label.html" %}
{% include "rest_framework/fields/vertical/label.html" %}
<select
multiple
class=
"form-control"
name=
"{{ field.
field_
name }}"
>
<select
multiple
class=
"form-control"
name=
"{{ field.name }}"
>
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<option
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
<option
value=
"{{ key }}"
{%
if
key
in
field
.
value
%}
selected
{%
endif
%}
>
{{ text }}
</option>
{% endfor %}
{% endfor %}
...
...
rest_framework/templates/rest_framework/fields/vertical/select_radio.html
View file @
a0e852a4
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div>
<div>
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<label
class=
"radio-inline"
>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"{{ field.
field_
name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
>
{{ text }}
{{ text }}
</label>
</label>
{% endfor %}
{% endfor %}
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
{% for key, text in field.choices.items %}
{% for key, text in field.choices.items %}
<div
class=
"radio"
>
<div
class=
"radio"
>
<label>
<label>
<input
type=
"radio"
name=
"{{ field.
field_
name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
"{{ key }}"
{%
if
key =
=
field
.
value
%}
checked
{%
endif
%}
>
{{ text }}
{{ text }}
</label>
</label>
</div>
</div>
...
...
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