#27128: A method model.objects.get(pk=obj.pk) returns many objects, but in a
database is one.
-------------------------------------+-------------------------------------
Reporter: setivolkylany | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 1.9
Severity: Normal | Resolution: needsinfo
Keywords: GenericRelation, | Triage Stage:
Testing, Models | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by timgraham):
If the queryset isn't ordered, each time you index
`get_user_model().objects.all()`, there's no guarantee that the results
will be in the same order. Try indexing
`get_user_model().objects.order_by('pk')` instead.
--
Ticket URL: <https://code.djangoproject.com/ticket/27128#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/071.8dee4c64f7e96dce81f4482c0e5e3dc2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.