@register.simple_tag
def admin_boolean_icon(val):
 if (django.VERSION > (1, 9)):
  ext = u'svg'
 else:
  ext = u'gif'
 icon_url = static(u'admin/img/icon-{0}.{1}'.format(TYPE_MAPPING[val], ext))
 return mark_safe(u'<img src="{url}" alt="{text}" title="{text}" />'.format(url=icon_url, text=NAME_MAPPING[val]))

@ register . simple_tag def admin_boolean_icon ( val ) : if ( django . VERSION > ( 1 , 9 ) ) : ext = u'svg' else : ext = u'gif' icon_url = static ( u'admin/img/icon-{0}.{1}' . format ( TYPE_MAPPING [ val ] , ext ) ) return mark_safe ( u'<img src="{url}" alt="{text}" title="{text}" />' . format ( url = icon_url , text = NAME_MAPPING [ val ] ) )
admin icon wrapper .