Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#30798 closed Bug (fixed)

models.E015 is raised when Meta.ordering contains "pk" of a related field.

Reported by: Mariusz Felisiak Owned by: Hasan Ramezani
Component: Database layer (models, ORM) Version: 3.0
Severity: Release blocker Keywords:
Cc: Hasan Ramezani Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

models.E015 is raised when Meta.ordering contains __pk of a related field, e.g.:

test_app.SomeModel: (models.E015) 'ordering' refers to the nonexistent field, related field, or lookup 'option__pk'.

Regression in 440505cb2cadbe1a5b9fba246bcde6c04f51d07e.

Attachments (1)

test-30798.diff (844 bytes ) - added by Mariusz Felisiak 5 years ago.
Regression test.

Download all attachments as: .zip

Change History (7)

by Mariusz Felisiak, 5 years ago

Attachment: test-30798.diff added

Regression test.

comment:1 by Hasan Ramezani, 5 years ago

Owner: changed from nobody to Hasan Ramezani
Status: newassigned

Thanks @felixxm for the test. I will prepare a fix for it.

comment:2 by Hasan Ramezani, 5 years ago

Has patch: set
Last edited 5 years ago by Mariusz Felisiak (previous) (diff)

comment:3 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In c7944628:

Refs #30798 -- Prevented chaining fields from the same related model multiple times in model Meta.ordering.

comment:4 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

Resolution: fixed
Status: assignedclosed

In 95a11578:

Fixed #30798 -- Fixed Meta.ordering validation for pk of related fields.

Regression in 440505cb2cadbe1a5b9fba246bcde6c04f51d07e.

comment:5 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In da8f85a:

[3.0.x] Refs #30798 -- Prevented chaining fields from the same related model multiple times in model Meta.ordering.

Backport of c7944628a1979453468d67818c63957532d396d8 from master

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In 0dc39ca8:

[3.0.x] Fixed #30798 -- Fixed Meta.ordering validation for pk of related fields.

Regression in 440505cb2cadbe1a5b9fba246bcde6c04f51d07e.

Backport of 95a11578ce41de1e152fe7d173f109e280aebd6d from master

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