Hi,
Unless you have applied ordering, either in model Meta, or in your query clause, results are really "in no particular order". Most of the databases do return results in order the data is read from the disk, but that's not quaranteed.
If you require ordering, add .order_by() to your query to guarantee wanted sorting.
On 5.9.2017 9.10, Priyanka Thakur wrote:
Hi,--
As part of migration to Django 1.10.4 from 1.7, I have noticed that queryset results are unsorted, compared to previous version.
Has same behaviour been observed by anyone?
Regards,Priyanka
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/777067c4-7a66-416d-8c5f-576566d6b4c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment