def ajax_editable_boolean_cell(item, attr, text='', override=None):
    if text:
        text = '&nbsp;(%s)' % text

    if override is not None:
        a = [django_boolean_icon(override, text), text]
    else:
        value = getattr(item, attr)
        a = [
            '<input type="checkbox" data-inplace data-inplace-id="%s"'
            ' data-inplace-attribute="%s" %s>' % (
                item.pk,
                attr,
                'checked="checked"' if value else '',
            )]

    a.insert(0, '<div id="wrap_%s_%d">' % (attr, item.pk))
    a.append('</div>')
    return ''.join(a)


# ------------------------------------------------------------------------
Generate a html snippet for showing a boolean value on the admin page.
dataset/ETHPy150Open feincms/feincms/feincms/admin/tree_editor.py/ajax_editable_boolean_cell