From 00734bca7ed94e36d62dfb306b8b9b48df74e766 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sat, 23 Sep 2006 12:11:37 +0000 Subject: [PATCH] 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 --- django/forms/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/django/forms/__init__.py b/django/forms/__init__.py index 544ea7dd4f4..537a109527a 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: