def pformat_django_context_html(object):
if isinstance(object, QuerySet):<EOL><INDENT>text = '<STR_LIT>'<EOL>lineno = <NUM_LIT:0><EOL>for item in object.all()[:<NUM_LIT>]:<EOL><INDENT>lineno += <NUM_LIT:1><EOL>if lineno >= <NUM_LIT>:<EOL><INDENT>text += u'<STR_LIT>'<EOL>break<EOL><DEDENT>text += u'<STR_LIT>'.format(escape(repr(item)))<EOL><DEDENT>return text<EOL><DEDENT>elif isinstance(object, Manager):<EOL><INDENT>return mark_safe(u'<STR_LIT>')<EOL><DEDENT>elif isinstance(object, six.string_types):<EOL><INDENT>return escape(repr(object))<EOL><DEDENT>elif isinstance(object, Promise):<EOL><INDENT>return escape(_format_lazy(object))<EOL><DEDENT>elif isinstance(object, dict):<EOL><INDENT>return _format_dict(object)<EOL><DEDENT>elif isinstance(object, list):<EOL><INDENT>return _format_list(object)<EOL><DEDENT>elif hasattr(object, '<STR_LIT>'):<EOL><INDENT>return _format_object(object)<EOL><DEDENT>else:<EOL><INDENT>text = DebugPrettyPrinter(width=<NUM_LIT:200>).pformat(object)<EOL>return _style_text(text)<EOL><DEDENT>
Dump a variable to a HTML string with sensible output for template context fields.
It filters out all fields which are not usable in a template context.