only last 50 chat messages are loaded on page load

This commit is contained in:
iou1name 2018-10-08 07:52:51 -04:00
parent e92e5686c3
commit 5f5591736f
2 changed files with 1 additions and 2 deletions

View File

@ -58,7 +58,7 @@ def quest(request, quest_id, page_num='0'):
quest=quest, appendix=False).order_by('page_num') quest=quest, appendix=False).order_by('page_num')
appendices = Page.objects.filter( appendices = Page.objects.filter(
quest=quest, appendix=True).order_by('title') 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: try:
page = Page.objects.get(quest=quest, page_num=page_num) page = Page.objects.get(quest=quest, page_num=page_num)
except Page.DoesNotExist: except Page.DoesNotExist:

1
todo
View File

@ -15,5 +15,4 @@ New post displays chat message
Poll vote highlights entire option Poll vote highlights entire option
Total voters per poll Total voters per poll
Chat archives Chat archives
Only last 100 (50?) chat messages are loaded on page load
Adjust quote preview postioning Adjust quote preview postioning