adrian wrote:
> Was wondering if anyone can point me in the right direction here, what
> would be the Django style way to annotate a set with a row number in
> some way like:-
>
> Book.objects.all().order_by('date_added').annotate(row_num=RowNumber
> ('id'))
Well many times the "Django style way" also happens to be the
Python way:
books = Book.objects.all().order_by('date_added')
for row_num, book in enumerate(books):
do_something(row_num, book)
-tim