feat: add people to projects and articles
This commit is contained in:
@@ -23,7 +23,7 @@ class ProductOverviewView(ListView):
|
||||
template_name = "products/overview.html"
|
||||
context_object_name = "main_products"
|
||||
queryset = MainProduct.objects.filter(is_active=True).prefetch_related(
|
||||
"sub_products"
|
||||
"sub_products", "people"
|
||||
)
|
||||
|
||||
|
||||
@@ -33,13 +33,13 @@ class MainProductDetailView(DetailView):
|
||||
context_object_name = "main_product"
|
||||
slug_url_kwarg = "main_slug"
|
||||
queryset = MainProduct.objects.filter(is_active=True).prefetch_related(
|
||||
"sub_products"
|
||||
"sub_products", "people"
|
||||
)
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["articles"] = self.object.articles.prefetch_related(
|
||||
"sections", "citations"
|
||||
"sections", "citations", "people"
|
||||
).all()
|
||||
videos = self.object.videos.filter(is_active=True).order_by("order", "pk")
|
||||
context.update(
|
||||
@@ -65,7 +65,7 @@ class SubProductDetailView(TemplateView):
|
||||
is_active=True,
|
||||
)
|
||||
sub_product = get_object_or_404(
|
||||
SubProduct,
|
||||
SubProduct.objects.prefetch_related("people"),
|
||||
slug=self.kwargs["sub_slug"],
|
||||
main_product=main_product,
|
||||
is_active=True,
|
||||
@@ -73,7 +73,7 @@ class SubProductDetailView(TemplateView):
|
||||
context["main_product"] = main_product
|
||||
context["sub_product"] = sub_product
|
||||
context["articles"] = sub_product.articles.prefetch_related(
|
||||
"sections", "citations"
|
||||
"sections", "citations", "people"
|
||||
).all()
|
||||
videos = sub_product.videos.filter(is_active=True).order_by("order", "pk")
|
||||
context.update(
|
||||
|
||||
Reference in New Issue
Block a user