Ticket #1583: admin_list.diff

File admin_list.diff, 1.1 KB (added by ubernostrum, 9 years ago)

Use path instead of non-existent thumbnail as admin list repr of ImageField

  • admin_list.py

     
    150150            elif isinstance(f, models.BooleanField) or isinstance(f, models.NullBooleanField):
    151151                BOOLEAN_MAPPING = {True: 'yes', False: 'no', None: 'unknown'}
    152152                result_repr = '<img src="%simg/admin/icon-%s.gif" alt="%s" />' % (settings.ADMIN_MEDIA_PREFIX, BOOLEAN_MAPPING[field_val], field_val)
    153             # ImageFields are special: Use a thumbnail.
     153            # ImageFields are special: Use the path to the image file.
    154154            elif isinstance(f, models.ImageField):
    155                 from django.parts.media.photos import get_thumbnail_url
    156                 result_repr = '<img src="%s" alt="%s" title="%s" />' % (get_thumbnail_url(getattr(result, 'get_%s_url' % f.name)(), '120'), field_val, field_val)
     155                result_repr = '%s' % f.path
    157156            # FloatFields are special: Zero-pad the decimals.
    158157            elif isinstance(f, models.FloatField):
    159158                if field_val is not None:
Back to Top