I've hard coded this 3 in my loop range because I was unable to get the actual length. I tried listing the available features but didn't found any print(dir(Todo_Item.objects)). Maybe is there any other better way to iterate over the object and stop when it ends? This is my code with hard coded 3 in loop range.
def home_view(request):
display_list = []
for i in range(3):
display_list.append(Todo_Item.objects.get(id=i+1).task)
.......some code below as well.......
My Todo app runs fine without any error but the only problem is this non-dynamic loop.
