def __init__(self, _, url, label, template="menu-item.html"): self.url = resolve_string(url) self.label = resolve_string(label) self.template = resolve_string(template)
def starts_with(value, arg): starter = resolve_string(arg) return unicode(value).find(starter) == 0
def widget_attr(value, arg): attrName, attrValue = resolve_string(arg).split(":") return value.as_widget(attrs={attrName: attrValue})