add related articles to detail views

This commit is contained in:
Tobias Brunner 2025-06-06 15:22:02 +02:00
parent b456816035
commit 18e9156683
Signed by: tobru
SSH key fingerprint: SHA256:kOXg1R6c11XW3/Pt9dbLdQvOJGFAy+B2K6v6PtRWBGQ
8 changed files with 140 additions and 0 deletions

View file

@ -64,9 +64,15 @@ def provider_detail(request, slug):
)
)
# Get related articles for this cloud provider
related_articles = provider.articles.filter(is_published=True).order_by(
"-created_at"
)[:3]
context = {
"provider": provider,
"services": services,
"ordered_offerings": ordered_offerings,
"related_articles": related_articles,
}
return render(request, "services/provider_detail.html", context)