summaryrefslogtreecommitdiff
path: root/django/forms/__init__.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2006-09-23 12:11:37 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2006-09-23 12:11:37 +0000
commit00734bca7ed94e36d62dfb306b8b9b48df74e766 (patch)
tree6e9bde1ad72b736cba3262b76d07fc486132d591 /django/forms/__init__.py
parent539438a2312b53211cddfee897b1dd398b360c99 (diff)
Fixed #2599 -- Fixed rendering problem in comma-separated integer fields.
Thanks, Christopher Lenz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3804 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/forms/__init__.py')
-rw-r--r--django/forms/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django/forms/__init__.py b/django/forms/__init__.py
index 544ea7dd4f..537a109527 100644
--- a/django/forms/__init__.py
+++ b/django/forms/__init__.py
@@ -969,6 +969,13 @@ class CommaSeparatedIntegerField(TextField):
except validators.ValidationError, e:
raise validators.CriticalValidationError, e.messages
+ def render(self, data):
+ if data is None:
+ data = ''
+ elif isinstance(data, (list, tuple)):
+ data = ','.join(data)
+ return super(CommaSeparatedIntegerField, self).render(data)
+
class RawIdAdminField(CommaSeparatedIntegerField):
def html2python(data):
if data: