diff --git a/uniweb/models.py b/uniweb/models.py index ffdeee74e1198ce86d14fbdcf491ba446a95171e..fdbbbabb8cd1354bc26d66e50646e64bb304a9d8 100644 --- a/uniweb/models.py +++ b/uniweb/models.py @@ -186,12 +186,11 @@ class ArticlesBlock(blocks.StructBlock): def get_context(self, value, parent_context=None): context = super().get_context(value, parent_context=parent_context) count = value["lines"] * ARTICLES_PER_LINE - context["articles"] = ( - value["page"] - .get_children() - .live() - .specific() - .order_by("-uniwebarticlepage__date")[:count] + articles_page = value["page"] + context["articles"] = articles_page.materialize_shared_articles_query( + articles_page.append_all_shared_articles_query( + UniwebArticlePage.objects.child_of(articles_page) + )[:count] ) return context