[Answered ]-Django get_next_by_date conditions not rendering properly in template

1đź‘Ť

âś…

You need to call the methods, so:

try:
    nextchapter = chapter.get_next_by_date()
except Chapter.DoesNotExist:
    nextchapter = None
try:
    prevchapter = chapter.get_previous_by_date()
except Chapter.DoesNotExist:
    prevchapter = None

Leave a comment