@register.inclusion_tag('lfs/catalog/breadcrumbs.html', takes_context=True)
def breadcrumbs(context, obj, current_page=''):
    """
    """
    if isinstance(obj, Category):
        cache_key = "%s-category-breadcrumbs-%s" % (settings.CACHE_MIDDLEWARE_KEY_PREFIX, obj.slug)
        objects = cache.get(cache_key)
        if objects is not None:
            return objects
        objects = [current_page] if current_page else []
        while obj is not None:
            objects.insert(0, {
                "name": obj.name,
                "url": obj.get_absolute_url(),
            })
            obj = obj.parent

        result = {
            "objects": objects,
            "STATIC_URL": context.get("STATIC_URL"),
        }
        cache.set(cache_key, result)
    elif isinstance(obj, Product):
        request = context.get("request")
        objects = [{
            "name": obj.get_name(),
            "url": obj.get_absolute_url(),
        }]
        # product page may be visited from manufacturer or category
        lm = request.session.get('last_manufacturer')
        if lm and obj.manufacturer == lm:
            objects.insert(0, {
                "name": lm.name,
                "url": lm.get_absolute_url(),
            })
            objects.insert(0, {
                "name": _(u"Manufacturers"),
                "url": reverse("lfs_manufacturers")})
        else:
            category = obj.get_current_category(request)
            if category:
                while category is not None:
                    objects.insert(0, {
                        "name": category.name,
                        "url": category.get_absolute_url(),
                    })
                    category = category.parent

        result = {
            "objects": objects,
            "STATIC_URL": context.get("STATIC_URL"),
        }
    elif isinstance(obj, Page):
        objects = []
        objects.append({
            "name": _(u"Information"),
            "url": reverse("lfs_pages")})
        objects.append({"name": obj.title})

        result = {
            "objects": objects,
            "STATIC_URL": context.get("STATIC_URL"),
        }
    elif isinstance(obj, Manufacturer):
        objects = []
        objects.append({
            "name": _(u"Manufacturers"),
            "url": reverse("lfs_manufacturers")})
        objects.append({"name": obj.name})

        result = {
            "objects": objects,
            "STATIC_URL": context.get("STATIC_URL"),
        }
    else:
        result = {
            "objects": ({"name": obj},),
            "STATIC_URL": context.get("STATIC_URL"),
        }

    return result
dataset/ETHPy150Open diefenbach/django-lfs/lfs/core/templatetags/lfs_tags.py/breadcrumbs/original