Re: Querysets and ROW_NUMBER

2009-04-08 Thread adrian
Thanks for the advice Tim. I ended up doing something similar, although not as elegant as your solution. I'll give it a go ;) cheers adrian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: Querysets and ROW_NUMBER

2009-04-08 Thread Tim Chase
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

Querysets and ROW_NUMBER

2009-04-07 Thread adrian
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')) Unfortunately PostgreSQL does not support ROW_NUMBER yet so I c