from django.template import defaultfilters as filters
from avocado.formatters import Formatter, registry


class HTMLFormatter(Formatter):
    def to_html(self, values, fields=None, **context):
        toks = []
        for value in values.values():
            if value is None:
                continue
            if type(value) is float:
                tok = filters.floatformat(value)
            else:
                tok = unicode(value)
            toks.append(tok)
        return u' '.join(toks)

    to_html.process_multiple = True


registry.register(HTMLFormatter, 'HTML')

from django.template import defaultfilters as filters
from avocado.formatters import Formatter


class HTMLFormatter(Formatter):
    delimiter = u' '

    html_map = {
        None: '<em>n/a</em>'
    }

    def to_html(self, values, **context):
        toks = []
        for value in values.values():
            # Check the html_map first
            if value in self.html_map:
                tok = self.html_map[value]
            # Ignore NoneTypes
            elif value is None:
                continue
            # Prettify floats
            elif type(value) is float:
                tok = filters.floatformat(value)
            else:
                tok = unicode(value)
            toks.append(tok)
        return self.delimiter.join(toks)

    to_html.process_multiple = True

Add `delimiter` and `html_map` to HTML formatter and do not register it by default
Add `delimiter` and `html_map` to HTML formatter and do not register it by default