From 11bcb50f72f25c51cc3128dfc27901ea55570274 Mon Sep 17 00:00:00 2001 From: Oleg Lavrovsky Date: Mon, 3 Jul 2017 17:04:09 +0200 Subject: [PATCH] 6 posts on homepage, not 4 --- publichealth/home/models/models.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/publichealth/home/models/models.py b/publichealth/home/models/models.py index 8741a98..758cd26 100644 --- a/publichealth/home/models/models.py +++ b/publichealth/home/models/models.py @@ -62,6 +62,10 @@ class ArticleIndexPage(Page): context['subcategories'] = subcategories return context + parent_page_types = [ + 'home.ArticleIndexPage', + 'home.HomePage' + ] subpage_types = [ 'home.ArticlePage', 'home.ArticleIndexPage', @@ -145,6 +149,10 @@ class ArticlePage(Page): MultiFieldPanel(Page.promote_panels, "Einstellungen"), ] + parent_page_types = [ + 'home.ArticleIndexPage', + 'home.HomePage' + ] subpage_types = [] class Meta: verbose_name = "Artikel" @@ -221,7 +229,7 @@ class HomePage(Page): entries = EntryPage.objects.live().descendant_of(parent[0]) # Order by most recent date first entries = entries.order_by('-date') - return entries[:4] + return entries[:6] def get_context(self, request): # Update template context