Similar to how Python's enumerate() works, I'd like to assign each row returned a unique increasing integer. (Not the row id, but rather the row number in the results!)
i.e.,
for p in models.People.objects.all().values('N', 'name'):
print p['N'], p['name']
with output of...
0 Mary
1 John
2 Nikita
3 Fred
In this particular case, I want to do this on the SQL backend and not simply wrap enumerate() around the query results.
I would also not expect the enumerations to be stable across queries where the data has changed.