wagtailでLearningWagtailをroutable Pageを作成しました。
そこで最新記事を表示するページ作成方法が書かれていたの実装しました。
python
1#Models.py 2 @route(r'^latest/$') 3 def latest_article_index(self,request, *args,**kwargs): 4 context = self.get_context(request, *args, **kwargs) 5 context["posts"] = context["posts"][:1] 6 return render(request,"articles/latest_index.html",context) 7
これで確かに最新ページ表示ができるようになりました。
ただ現時点で、2ページに分かれていてそれぞれが最新ページを保有している状態です。
これを以下のように2ページの最新を結合して、表示したいのですが、どうすればよいですか?
あなたの回答
tips
プレビュー