Ticket #18618: 18618.diff

File 18618.diff, 702 bytes (added by tangc, 12 years ago)
  • django/contrib/admin/util.py

    diff -r f1bbf3149349 django/contrib/admin/util.py
    a b  
    314314    from django.contrib.admin.views.main import EMPTY_CHANGELIST_VALUE
    315315
    316316    if field.flatchoices:
     317        if isinstance(value, (list, tuple)):
     318            ret = []
     319            for v in value:
     320                ret.append(dict(field.flatchoices).get(v, EMPTY_CHANGELIST_VALUE))
     321            return '; '.join(ret)
    317322        return dict(field.flatchoices).get(value, EMPTY_CHANGELIST_VALUE)
    318323    # NullBooleanField needs special-case null-handling, so it comes
    319324    # before the general null test.
Back to Top