from apps.products.models import MainProduct


def navigation(request):
    main_products = (
        MainProduct.objects.filter(is_active=True)
        .prefetch_related("sub_products")
        .order_by("order", "name")
    )
    return {"nav_main_products": main_products}
