from django.utils.text import slugify
from django.utils.html import format_html


class MenuItem(object):
    def __init__(self, label, url, name=None, classnames='', order=1000):
        self.label = label
        self.url = url
        self.classnames = classnames
        self.name = (name or slugify(unicode(label)))
        self.order = order

    def render_html(self):
        return format_html(
            u"""<li class="menu-{0}"><a href="{1}" class="{2}">{3}</a></li>""",
            self.name, self.url, self.classnames, self.label)

[((14, 15, 16, 61), 'django.utils.html.format_html', 'format_html', ({(15, 12, 15, 78): 'u"""<li class="menu-{0}"><a href="{1}" class="{2}">{3}</a></li>"""', (16, 12, 16, 21): 'self.name', (16, 23, 16, 31): 'self.url', (16, 33, 16, 48): 'self.classnames', (16, 50, 16, 60): 'self.label'}, {}), '(u\'<li class="menu-{0}"><a href="{1}" class="{2}">{3}</a></li>\',\n    self.name, self.url, self.classnames, self.label)', False, 'from django.utils.html import format_html\n')]