django queryset to instance 1

django queryset to instance

for e in Entry.objects.all():
    print(e.headline)

Here is what the above code is Doing:
1. Import the Entry model from the blog app.
2. Get all Entry objects, in date-published order.
3. Loop over each Entry object and print out its headline.

Similar Posts