From 5f5591736fc724ee13ff359dda6f9857994caa94 Mon Sep 17 00:00:00 2001 From: iou1name Date: Mon, 8 Oct 2018 07:52:51 -0400 Subject: [PATCH] only last 50 chat messages are loaded on page load --- quest/views.py | 2 +- todo | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/quest/views.py b/quest/views.py index 5dba0c2..d571c66 100644 --- a/quest/views.py +++ b/quest/views.py @@ -58,7 +58,7 @@ def quest(request, quest_id, page_num='0'): quest=quest, appendix=False).order_by('page_num') appendices = Page.objects.filter( quest=quest, appendix=True).order_by('title') - chat_messages = quest.message_set.all() + chat_messages = reversed(quest.message_set.all().order_by('-id')[:50]) try: page = Page.objects.get(quest=quest, page_num=page_num) except Page.DoesNotExist: diff --git a/todo b/todo index 349c053..0be5d78 100644 --- a/todo +++ b/todo @@ -15,5 +15,4 @@ New post displays chat message Poll vote highlights entire option Total voters per poll Chat archives -Only last 100 (50?) chat messages are loaded on page load Adjust quote preview postioning