Ticket #8746: raw_id_field_more_tolerant.diff

File raw_id_field_more_tolerant.diff, 546 bytes (added by jfw, 16 years ago)
  • django/contrib/admin/widgets.py

     
    174174    def value_from_datadict(self, data, files, name):
    175175        value = data.get(name, None)
    176176        if value and ',' in value:
    177             return data[name].split(',')
     177            return filter(None, [v.strip() for v in data[name].split(',')])
    178178        if value:
    179179            return [value]
    180180        return None
Back to Top