mirror of
https://github.com/django/django.git
synced 2025-09-03 17:21:00 +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:
parent
539438a231
commit
00734bca7e
1 changed files with 7 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue