From 9c6bead8b6d3f9ae11e9859ed305e8d0f7a9e0d8 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 20 Nov 2014 12:38:08 +0000 Subject: [PATCH] Add --- null option for selects. Closes #2096. --- .../templates/rest_framework/horizontal/select.html | 3 +++ rest_framework/templates/rest_framework/inline/select.html | 5 ++++- rest_framework/templates/rest_framework/vertical/select.html | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/rest_framework/templates/rest_framework/horizontal/select.html b/rest_framework/templates/rest_framework/horizontal/select.html index 1d00f4241..380b38e94 100644 --- a/rest_framework/templates/rest_framework/horizontal/select.html +++ b/rest_framework/templates/rest_framework/horizontal/select.html @@ -4,6 +4,9 @@ {% endif %}
+ {% if field.allow_null %} + + {% endif %} {% for key, text in field.choices.items %} - + {% endfor %}
diff --git a/rest_framework/templates/rest_framework/vertical/select.html b/rest_framework/templates/rest_framework/vertical/select.html index 7c673ebb5..de72e1ddb 100644 --- a/rest_framework/templates/rest_framework/vertical/select.html +++ b/rest_framework/templates/rest_framework/vertical/select.html @@ -3,8 +3,11 @@ {% endif %} {% if field.errors %}