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:
parent
539438a231
commit
00734bca7e
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue