def render(self, context): current_rule = get_value(self.current_rule, context) current_obj = get_value(self.current_obj, context) if current_rule is None: ancestors = [] else: current = MenuItem(current_rule, current_obj) ancestors = current.ancestors() context['menuproxy_breadcrumbs'] = ancestors return u''
def render(self, context): between_char = get_value(self.between_char, context) if 'menuproxy_breadcrumbs' in context: current = None ancestors = context['menuproxy_breadcrumbs'] else: current_rule = get_value(self.current_rule, context) current_obj = get_value(self.current_obj, context) if current_rule is None: current = None ancestors = [] else: current = MenuItem(current_rule, current_obj) ancestors = current.ancestors() return render_to_string('menuproxy/breadcrumbs.html', { 'current': current, 'breadcrumbs': ancestors, 'breadcrumb_between_char': between_char, }, context_instance=template.RequestContext(context.get('request', HttpRequest())))