#15319: _get_next_or_previous_by_FIELD populated from Meta
--------------------------------------------------------+-------------------
Reporter: alexr | Owner: nobody
Status: new | Milestone:
Component: Database layer (models, ORM) | Version: SVN
Resolution: | Keywords:
Triage Stage: Design decision needed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 |
--------------------------------------------------------+-------------------
Comment (by alexr):
http://code.djangoproject.com/browser/django/trunk/django/db/models/base.py#L589
I think the idea is to fall back to ordering by pk so that nothing is
missed if the seekable field has duplicate values.
If we ordered by FOO, which was also the pk field, we'd end up with a
query like this (for get_next):
{{{#!python
MyObj.objects.filter(Q(FOO__gt=self.FOO)|Q(FOO__gt=self.FOO)).order_by('FOO',
'FOO')
}}}
Looking at it, I guess that query would run ok, it just looks weird.
--
Ticket URL: <http://code.djangoproject.com/ticket/15319#comment:6>
Django <http://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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.