Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#22711 closed Bug (fixed)

Check framework doesn't allow model's Meta.ordering attribute to have explicit ForeignKey relation fields

Reported by: Althalus Owned by: nobody
Component: Core (System checks) Version: dev
Severity: Release blocker Keywords: meta, ordering, check framework
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

In #19195 was introduced a way to perform ordering by ForeignKey field itself (without any joins), e.g. order_by('fk_field_name_id'). But new django 1.7 system check framework does not respect this change and does not at the moment allow such fields to be in model's Meta.ordering attribute.
If you skip this check everything just work as expected, so the only problem is that correct ordering value is treated as invalid.

PS. I've marked this ticket as release blocker because initial ticket had this severity.

Change History (5)

comment:1 by Althalus, 10 years ago

Created pull request on GitHib: https://github.com/django/django/pull/2723

comment:2 by Simon Charette, 10 years ago

Needs tests: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

Left comment on the PR.

comment:3 by Simon Charette, 10 years ago

Triage Stage: AcceptedReady for checkin

Patch looks good to me, will test locally and commit.

comment:4 by Simon Charette <charette.s@…>, 10 years ago

Resolution: fixed
Status: newclosed

In d04e7302240f5be34cdd303002bc8e7dcd81f529:

Fixed #22711 -- Adjusted ordering checks to allow implicit relation fields.

refs #19195.

comment:5 by Simon Charette <charette.s@…>, 10 years ago

In d773a08b270e3b2c387985a9d9a4d01c991469c8:

[1.7.x] Fixed #22711 -- Adjusted ordering checks to allow implicit relation fields.

refs #19195.

Backport of d04e730224 from master

Note: See TracTickets for help on using tickets.
Back to Top