def format_status(self, request, obj, fieldname, *args, **kwargs): status = getattr(obj, fieldname) column_formatters_args = getattr(self, 'column_formatters_args', {}) _args = column_formatters_args.get('status', {}).get(fieldname, {}) labels = _args.get('labels', {}) return html.span(class_="label label-{0}".format( labels.get(status, 'default')), style=_args.get('style', 'min-height:18px;'))(status)
def format_status(self, request, obj, fieldname, *args, **kwargs): status = getattr(obj, fieldname) column_formatters_args = getattr(self, 'column_formatters_args', {}) _args = column_formatters_args.get('status', {}).get(fieldname, {}) labels = _args.get('labels', {}) return html.span( class_="label label-{0}".format(labels.get(status, 'default')), style=_args.get('style', 'min-height:18px;') )(status)