1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

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
This commit is contained in:
Malcolm Tredinnick 2006-09-23 12:11:37 +00:00
parent 539438a231
commit 00734bca7e

View File

@ -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: