From fdd811ec53b3bdc46a2c934422066e1aa9f9dd05 Mon Sep 17 00:00:00 2001 From: Aider Ibragimov Date: Wed, 4 Mar 2015 08:22:46 +0300 Subject: [PATCH] Allow blank/null on radio.html choices --- .../rest_framework/horizontal/radio.html | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/rest_framework/templates/rest_framework/horizontal/radio.html b/rest_framework/templates/rest_framework/horizontal/radio.html index 52238bb1a..efca2883e 100644 --- a/rest_framework/templates/rest_framework/horizontal/radio.html +++ b/rest_framework/templates/rest_framework/horizontal/radio.html @@ -1,20 +1,36 @@ +{% load i18n %} +
{% if field.label %} {% endif %}
{% if style.inline %} + {% if field.allow_null or field.allow_blank %} + + {% endif %} {% for key, text in field.choices.items %} {% endfor %} {% else %} + {% if field.allow_null or field.allow_blank %} +
+ +
+ {% endif %} {% for key, text in field.choices.items %}