Specifically, I have a model that has a field like this
pub_date = models.DateField(\"date published\")
I want to be able to easily grab the ob
Note:
Normal python lists accept negative indexes, which signify an offset from the end of the list, rather than the beginning like a positive number. However, QuerySet objects will raise
AssertionError: Negative indexing is not supported.if you use a negative index, which is why you have to do what insin said: reverse the ordering and grab the
0th
element.