[Django] #26526: latest() QuerySet method should ignore null values

16 views
Skip to first unread message

Django

unread,
Apr 21, 2016, 10:27:34 AM4/21/16
to django-...@googlegroups.com
#26526: latest() QuerySet method should ignore null values
--------------------------------------+--------------------
Reporter: int-ua | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+--------------------
When sorting by date null values mean that date is unknown. Is there a
reason to put them before any known date? Absence of date doesn't
necessary mean an event will happen in the future, it means that the date
is unknown. And word 'latest' suggests sorting by a known date.

--
Ticket URL: <https://code.djangoproject.com/ticket/26526>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 21, 2016, 10:36:01 AM4/21/16
to django-...@googlegroups.com
#26526: Document QuerySet.latest() behavior for null values
-------------------------------------+-------------------------------------
Reporter: int-ua | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_docs: => 0
* component: Uncategorized => Documentation
* needs_tests: => 0


Comment:

Django simply delegates to the database's ordering of null values. I'm not
sure if Django should also add filtering to exclude null values -- that
seems a bit magical to me. However, you could raise the idea on the
DevelopersMailingList. For now, I'll accept the ticket as a documentation
improvement.

--
Ticket URL: <https://code.djangoproject.com/ticket/26526#comment:1>

Django

unread,
Apr 21, 2016, 11:32:03 AM4/21/16
to django-...@googlegroups.com
#26526: Document QuerySet.latest() behavior for null values
-------------------------------------+-------------------------------------
Reporter: int-ua | Owner: nobody

Type: | Status: new
Cleanup/optimization |
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by int-ua):

Thank you, I've found related ticket about ordering NULL: #13312

--
Ticket URL: <https://code.djangoproject.com/ticket/26526#comment:2>

Django

unread,
Apr 21, 2016, 11:47:10 AM4/21/16
to django-...@googlegroups.com
#26526: Document QuerySet.latest() behavior for null values
--------------------------------------+------------------------------------

Reporter: int-ua | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/26526#comment:3>

Django

unread,
Apr 26, 2016, 10:16:59 PM4/26/16
to django-...@googlegroups.com
#26526: Document QuerySet.latest() behavior for null values
--------------------------------------+------------------------------------
Reporter: int-ua | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by betojulio):

hi, If there is no problem I would like to claim this ticket.

--
Ticket URL: <https://code.djangoproject.com/ticket/26526#comment:4>

Django

unread,
Apr 27, 2016, 8:09:12 AM4/27/16
to django-...@googlegroups.com
#26526: Document QuerySet.latest() behavior for null values
--------------------------------------+------------------------------------
Reporter: int-ua | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by timgraham):

Sure, no need to ask unless it looks like someone else might be working on
it. See our docs for
[https://docs.djangoproject.com/en/dev/internals/contributing/writing-code
/submitting-patches/#claiming-tickets Claiming tickets].

--
Ticket URL: <https://code.djangoproject.com/ticket/26526#comment:5>

Django

unread,
Apr 27, 2016, 1:28:46 PM4/27/16
to django-...@googlegroups.com
#26526: Document QuerySet.latest() behavior for null values
--------------------------------------+------------------------------------
Reporter: int-ua | Owner: ParvJain
Type: Cleanup/optimization | Status: assigned

Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by ParvJain):

* owner: nobody => ParvJain
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/26526#comment:6>

Django

unread,
Apr 27, 2016, 1:52:51 PM4/27/16
to django-...@googlegroups.com
#26526: Document QuerySet.latest() behavior for null values
--------------------------------------+------------------------------------
Reporter: int-ua | Owner: ParvJain
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by int-ua):

N.B.: according to #13312 different DBMS behave differently.

--
Ticket URL: <https://code.djangoproject.com/ticket/26526#comment:7>

Django

unread,
Jun 2, 2016, 1:06:48 PM6/2/16
to django-...@googlegroups.com
#26526: Document QuerySet.latest() behavior for null values
--------------------------------------+------------------------------------
Reporter: int-ua | Owner:
Type: Cleanup/optimization | Status: new

Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by carljm):

* owner: ParvJain =>
* status: assigned => new


Comment:

Since there hasn't been apparent progress in the 5 weeks since the ticket
was claimed, de-assigning it to free it up for a PyCon sprinter.

--
Ticket URL: <https://code.djangoproject.com/ticket/26526#comment:8>

Django

unread,
Jun 2, 2016, 1:17:14 PM6/2/16
to django-...@googlegroups.com
#26526: Document QuerySet.latest() behavior for null values
--------------------------------------+------------------------------------
Reporter: int-ua | Owner: g3rd
Type: Cleanup/optimization | Status: assigned

Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by g3rd):

* status: new => assigned

* owner: => g3rd


--
Ticket URL: <https://code.djangoproject.com/ticket/26526#comment:9>

Django

unread,
Jun 2, 2016, 1:56:21 PM6/2/16
to django-...@googlegroups.com
#26526: Document QuerySet.latest() behavior for null values
--------------------------------------+------------------------------------
Reporter: int-ua | Owner: g3rd
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by g3rd):

Pull request: https://github.com/django/django/pull/6689

--
Ticket URL: <https://code.djangoproject.com/ticket/26526#comment:10>

Django

unread,
Jun 2, 2016, 1:58:45 PM6/2/16
to django-...@googlegroups.com
#26526: Document QuerySet.latest() behavior for null values
--------------------------------------+------------------------------------
Reporter: int-ua | Owner: g3rd
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by g3rd):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/26526#comment:11>

Django

unread,
Jun 2, 2016, 7:42:50 PM6/2/16
to django-...@googlegroups.com
#26526: Document QuerySet.latest() behavior for null values
--------------------------------------+------------------------------------
Reporter: int-ua | Owner: g3rd
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"e6c5e68acd4bff90e371fd148ed6976e147692ad" e6c5e68a]:
{{{
#!CommitTicketReference repository=""
revision="e6c5e68acd4bff90e371fd148ed6976e147692ad"
Fixed #26526 -- Documented QuerySet.latest()'s dependency on database
ordering.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26526#comment:12>

Django

unread,
Jun 2, 2016, 7:43:20 PM6/2/16
to django-...@googlegroups.com
#26526: Document QuerySet.latest() behavior for null values
--------------------------------------+------------------------------------
Reporter: int-ua | Owner: g3rd
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"cd4246aab1740d77fa6ebd66c7d2053634501598" cd4246aa]:
{{{
#!CommitTicketReference repository=""
revision="cd4246aab1740d77fa6ebd66c7d2053634501598"
[1.10.x] Fixed #26526 -- Documented QuerySet.latest()'s dependency on
database ordering.

Backport of e6c5e68acd4bff90e371fd148ed6976e147692ad from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26526#comment:13>

Django

unread,
Jun 2, 2016, 7:43:21 PM6/2/16
to django-...@googlegroups.com
#26526: Document QuerySet.latest() behavior for null values
--------------------------------------+------------------------------------
Reporter: int-ua | Owner: g3rd
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"9d52cdfbbc02a21fafc74146c571ac6e50812a00" 9d52cdfb]:
{{{
#!CommitTicketReference repository=""
revision="9d52cdfbbc02a21fafc74146c571ac6e50812a00"
[1.9.x] Fixed #26526 -- Documented QuerySet.latest()'s dependency on
database ordering.

Backport of e6c5e68acd4bff90e371fd148ed6976e147692ad from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26526#comment:14>

Reply all
Reply to author
Forward
0 new messages