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
fdd811ec
Commit
fdd811ec
authored
Mar 04, 2015
by
Aider Ibragimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow blank/null on radio.html choices
parent
93299813
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
rest_framework/templates/rest_framework/horizontal/radio.html
+18
-2
No files found.
rest_framework/templates/rest_framework/horizontal/radio.html
View file @
fdd811ec
{% load i18n %}
<div
class=
"form-group"
>
{% if field.label %}
<label
class=
"col-sm-2 control-label {% if style.hide_label %}sr-only{% endif %}"
>
{{ field.label }}
</label>
{% endif %}
<div
class=
"col-sm-10"
>
{% if style.inline %}
{% if field.allow_null or field.allow_blank %}
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
""
{%
if
not
field
.
value
%}
checked
{%
endif
%}
/>
{% trans "None" %}
</label>
{% endif %}
{% for key, text in field.choices.items %}
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"{{ 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 }}
</label>
{% endfor %}
{% else %}
{% if field.allow_null or field.allow_blank %}
<div
class=
"radio"
>
<label>
<input
type=
"radio"
name=
"{{ field.name }}"
value=
""
{%
if
not
field
.
value
%}
checked
{%
endif
%}
/>
{% trans "None" %}
</label>
</div>
{% endif %}
{% for key, text in field.choices.items %}
<div
class=
"radio"
>
<label>
<input
type=
"radio"
name=
"{{ 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 }}
</label>
</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