I think that `_get_deterministic_ordering()` should check for the presence
of `UniqueConstraints` as well, which currently aren’t considered by the
discovery algorithm.
I noticed the docs currently advise against using `unique_together` in
favor of `UniqueConstraint`, suggesting the former may be deprecated in
the future, so this fix would change that part of the code accordingly.
I'm willing to submit a PR for this.
Cheers,
Fabio
--
Ticket URL: <https://code.djangoproject.com/ticket/31187>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* owner: nobody => Fabio Sangiovanni
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/31187#comment:1>
* type: New feature => Bug
* stage: Unreviewed => Accepted
Comment:
Agreed, we need to remember to ignore `UniqueConstraint`'s with
`condition`'s.
--
Ticket URL: <https://code.djangoproject.com/ticket/31187#comment:2>
* has_patch: 0 => 1
Comment:
PR: [https://github.com/django/django/pull/12364]
--
Ticket URL: <https://code.djangoproject.com/ticket/31187#comment:3>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"d270c10a723ca04e467e08d6d8b38ae392191f2d" d270c10a]:
{{{
#!CommitTicketReference repository=""
revision="d270c10a723ca04e467e08d6d8b38ae392191f2d"
Refs #31187 -- Added total_unique_constraints property to model's Options.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31187#comment:4>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"b457068cf272bc9912187a2b7aaaa4445110735e" b457068c]:
{{{
#!CommitTicketReference repository=""
revision="b457068cf272bc9912187a2b7aaaa4445110735e"
Fixed #31187 -- Fixed detecting of existing total ordering in admin
changelist when using Meta.constraints.
Detection of existing total ordering in admin changelist now takes into
account non-partial unique constraints.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31187#comment:5>