Permalink
Browse files

Fixed #2599 -- Fixed rendering problem in comma-separated integer fie…

…lds.

Thanks, Christopher Lenz.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3804 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 539438a commit 00734bca7ed94e36d62dfb306b8b9b48df74e766 @malcolmt malcolmt committed Sep 23, 2006
Showing with 7 additions and 0 deletions.
  1. +7 −0 django/forms/__init__.py
View
7 django/forms/__init__.py
@@ -969,6 +969,13 @@ def isCommaSeparatedIntegerList(self, field_data, all_data):
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:

0 comments on commit 00734bc

Please sign in to comment.