Apologies, I am completely new to Django and Python.
I have 2 questions. First, how would I go about getting the last object created (or highest pk) in a list of obj
alternative for the latest object created:
List.objects.all()[List.objects.count()-1]
It is necessary to add an AssertionError for the case when there are no items in the list.
except AssertionError: ...