def ajax_editable_boolean_cell(item, attr, text=u'', override=None):
 if text:
  text = (u'&nbsp;(%s)' % text)
 if (override is not None):
  a = [django_boolean_icon(override, text), text]
 else:
  value = getattr(item, attr)
  a = [(u'<input type="checkbox" data-inplace data-inplace-id="%s" data-inplace-attribute="%s" %s>' % (item.pk, attr, (u'checked="checked"' if value else u'')))]
 a.insert(0, (u'<div id="wrap_%s_%d">' % (attr, item.pk)))
 a.append(u'</div>')
 return mark_safe(u''.join(a))

def ajax_editable_boolean_cell ( item , attr , text = u'' , override = None ) : if text : text = ( u'&nbsp;(%s)' % text ) if ( override is not None ) : a = [ django_boolean_icon ( override , text ) , text ] else : value = getattr ( item , attr ) a = [ ( u'<input type="checkbox" data-inplace data-inplace-id="%s" data-inplace-attribute="%s" %s>' % ( item . pk , attr , ( u'checked="checked"' if value else u'' ) ) ) ] a . insert ( 0 , ( u'<div id="wrap_%s_%d">' % ( attr , item . pk ) ) ) a . append ( u'</div>' ) return mark_safe ( u'' . join ( a ) )
generate a html snippet for showing a boolean value on the admin page .