Re: [Django] #13296: order_with_respect_to fails to correctly track _order after deleting entries

14 views
Skip to first unread message

Django

unread,
Aug 21, 2011, 9:45:52 PM8/21/11
to django-...@googlegroups.com
#13296: order_with_respect_to fails to correctly track _order after deleting
entries
-------------------------------------+-------------------------------------
Reporter: krijesta | Owner: nobody
Type: Bug | Status: reopened
Milestone: | Component: Database layer
Version: 1.1 | (models, ORM)
Resolution: | Severity: Normal
Triage Stage: Accepted | Keywords:
Needs documentation: 0 | Has patch: 1
Patch needs improvement: 0 | Needs tests: 0
UI/UX: 0 | Easy pickings: 0
-------------------------------------+-------------------------------------
Changes (by DrMeers):

* has_patch: 0 => 1
* ui_ux: => 0
* easy: => 0


Comment:

I think changing the insertion order value calculation is the better
solution here; less expensive than reordering everything and simpler than
detection deletions *and* parent updates, etc. Patch and tests attached.

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

Django

unread,
Aug 28, 2011, 9:11:27 AM8/28/11
to django-...@googlegroups.com
#13296: order_with_respect_to fails to correctly track _order after deleting
entries
-------------------------------------+-------------------------------------
Reporter: krijesta | Owner: nobody
Type: Bug | Status: reopened
Milestone: | Component: Database layer
Version: 1.1 | (models, ORM)
Resolution: | Severity: Normal
Triage Stage: Accepted | Keywords:
Needs documentation: 0 | Has patch: 1
Patch needs improvement: 0 | Needs tests: 0
UI/UX: 0 | Easy pickings: 0
-------------------------------------+-------------------------------------

Comment (by julien):

Thanks for the patch, Simon! It looks pretty good to me. I'm just
wondering if the tests could be made a little more thorough by adding more
items, by doing more delete/add/move operations and by asserting the
actual values of each item's `_order` field. What do you think?

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

Django

unread,
Aug 28, 2011, 8:16:40 PM8/28/11
to django-...@googlegroups.com
#13296: order_with_respect_to fails to correctly track _order after deleting
entries
-------------------------------------+-------------------------------------
Reporter: krijesta | Owner: nobody
Type: Bug | Status: reopened
Milestone: | Component: Database layer
Version: 1.1 | (models, ORM)
Resolution: | Severity: Normal
Triage Stage: Accepted | Keywords:
Needs documentation: 0 | Has patch: 1
Patch needs improvement: 0 | Needs tests: 0
UI/UX: 0 | Easy pickings: 0
-------------------------------------+-------------------------------------

Comment (by DrMeers):

I was steering away from making the tests '''too''' explicit, particularly
in regard to the value of the `_order` field -- I'd prefer to test the
behaviour rather than the implementation. Currently, for efficiency's
sake, if you delete an item you'll get a "gap" in the `_order` sequence. I
don't actually ''want'' the "gap" so much that I want to test for it, and
would like the tests to continue to pass even if someone later decides to
trigger reordering upon modification, or even if they wanted to switch
between zero/one-based indexing.

Another test or two based on delete/add/move operations wouldn't hurt,
though those I'd written were enough to convince me there were no logic
holes.

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

Django

unread,
Jun 13, 2014, 9:10:14 PM6/13/14
to django-...@googlegroups.com
#13296: order_with_respect_to fails to correctly track _order after deleting
entries
-------------------------------------+-------------------------------------
Reporter: krijesta | Owner: nobody
Type: Bug | Status: new

Component: Database layer | Version: 1.1
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 1

Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timo):

* needs_better_patch: 0 => 1


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

Django

unread,
Aug 30, 2019, 4:45:58 AM8/30/19
to django-...@googlegroups.com
#13296: order_with_respect_to fails to correctly track _order after deleting
entries
-------------------------------------+-------------------------------------
Reporter: Chris | Owner: nobody

Type: Bug | Status: new
Component: Database layer | Version: 1.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hasan Ramezani):

* needs_better_patch: 1 => 0


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

Django

unread,
Aug 30, 2019, 4:48:54 AM8/30/19
to django-...@googlegroups.com
#13296: order_with_respect_to fails to correctly track _order after deleting
entries
-------------------------------------+-------------------------------------
Reporter: Chris | Owner: Hasan
| Ramezani
Type: Bug | Status: assigned

Component: Database layer | Version: 1.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Hasan Ramezani):

* status: new => assigned
* owner: nobody => Hasan Ramezani


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

Django

unread,
Sep 23, 2019, 5:46:22 AM9/23/19
to django-...@googlegroups.com
#13296: order_with_respect_to fails to correctly track _order after deleting
entries
-------------------------------------+-------------------------------------
Reporter: Chris | Owner: Hasan
| Ramezani
Type: Bug | Status: closed

Component: Database layer | Version: 1.1
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"f97bbad908df128189eff77d98af9a25ed1ecf23" f97bbad]:
{{{
#!CommitTicketReference repository=""
revision="f97bbad908df128189eff77d98af9a25ed1ecf23"
Fixed #13296 -- Fixed ordering by Options.order_with_respect_to after
deleting objects.

Thanks Simon Meers for the original patch.
}}}

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

Django

unread,
Sep 23, 2019, 5:46:58 AM9/23/19
to django-...@googlegroups.com
#13296: order_with_respect_to fails to correctly track _order after deleting
entries
-------------------------------------+-------------------------------------
Reporter: Chris | Owner: Hasan
| Ramezani
Type: Bug | Status: closed
Component: Database layer | Version: 1.1
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"2362f2726558dd0cc6e447878545dd3ddbd9b633" 2362f272]:
{{{
#!CommitTicketReference repository=""
revision="2362f2726558dd0cc6e447878545dd3ddbd9b633"
[3.0.x] Fixed #13296 -- Fixed ordering by Options.order_with_respect_to
after deleting objects.

Thanks Simon Meers for the original patch.

Backport of f97bbad908df128189eff77d98af9a25ed1ecf23 from master
}}}

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

Reply all
Reply to author
Forward
0 new messages