@permission_required("core.manage_shop")
def children_categories(request, category, product_category_ids,
                        template_name="manage/product/categories_children.html"):
    """Renders the children categories of given category as HTML.
    """
    categories = []
    for category in category.category_set.all():

        children = children_categories(request, category, product_category_ids)

        categories.append({
            "id": category.id,
            "slug": category.slug,
            "name": category.name,
            "url": category.get_absolute_url(),
            "checked": category.id in product_category_ids,
            "children": children,
        })

    result = render_to_string(template_name, RequestContext(request, {
        "categories": categories
    }))

    return result


# Actions
dataset/ETHPy150Open diefenbach/django-lfs/lfs/manage/product/categories.py/children_categories/original