summaryrefslogtreecommitdiff
path: root/django/newforms/fields.py
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-01-09 05:12:25 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-01-09 05:12:25 +0000
commitfb60a6ff0acc84417ced061e83bb170fff351b59 (patch)
tree3b7bf5cf6373a50430276bc3d479c32054e6c0ea /django/newforms/fields.py
parent2e148d70647bfab640ab395fc98ba9492d061dad (diff)
Fixed #3193 -- newforms: Modified as_hidden() to handle MultipleChoiceField correctly. Thanks for the report, Honza Kral
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4298 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/newforms/fields.py')
-rw-r--r--django/newforms/fields.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/newforms/fields.py b/django/newforms/fields.py
index 408c90df45..e3c1cee87a 100644
--- a/django/newforms/fields.py
+++ b/django/newforms/fields.py
@@ -4,7 +4,7 @@ Field classes
from django.utils.translation import gettext
from util import ValidationError, smart_unicode
-from widgets import TextInput, PasswordInput, CheckboxInput, Select, SelectMultiple
+from widgets import TextInput, PasswordInput, HiddenInput, MultipleHiddenInput, CheckboxInput, Select, SelectMultiple
import datetime
import re
import time
@@ -29,6 +29,7 @@ except NameError:
class Field(object):
widget = TextInput # Default widget to use when rendering this type of Field.
+ hidden_widget = HiddenInput # Default widget to use when rendering this as "hidden".
# Tracks each time a Field instance is created. Used to retain order.
creation_counter = 0
@@ -336,6 +337,8 @@ class ChoiceField(Field):
return value
class MultipleChoiceField(ChoiceField):
+ hidden_widget = MultipleHiddenInput
+
def __init__(self, choices=(), required=True, widget=SelectMultiple, label=None, initial=None):
ChoiceField.__init__(self, choices, required, widget, label, initial)