Opened 13 months ago

Closed 13 months ago

Last modified 13 months 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: master
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 Changed 13 months ago by Althalus

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

comment:2 Changed 13 months ago by charettes

  • Needs tests set
  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

Left comment on the PR.

comment:3 Changed 13 months ago by charettes

  • Triage Stage changed from Accepted to Ready for checkin

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

comment:4 Changed 13 months ago by Simon Charette <charette.s@…>

  • Resolution set to fixed
  • Status changed from new to closed

In d04e7302240f5be34cdd303002bc8e7dcd81f529:

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

refs #19195.

comment:5 Changed 13 months ago by Simon Charette <charette.s@…>

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