Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#14513 closed (fixed)

Ordering Check in django/core/management/validation.py

Reported by: Klaas van Schelven Owned by: nobody
Component: Database layer (models, ORM) Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

django/core/management/validation.py, both in the current trunk and in 1.2.3
It says in the accompanying comment:

# Skip ordering in the format field1__field2 (FIXME: checking 
# this format would be nice, but it's a little fiddly). 

However, the actual check is for only one "_". Which leads fieldnames which contain underscores to not be checked for
ordering;

The patch would be something like this:

260c260 
<                 if '__' in field_name: 
--- 
>                 if '_' in field_name: 

I will go through some hoops to put up an actual patch here.

Attachments (1)

django-14513-e62b9ba4e02c.diff (2.0 KB) - added by Klaas van Schelven 6 years ago.
Patch

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by Klaas van Schelven

Patch

comment:1 Changed 6 years ago by Klaas van Schelven

Has patch: set
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:2 Changed 6 years ago by Łukasz Rekucki

Component: UncategorizedDatabase layer (models, ORM)
Triage Stage: UnreviewedReady for checkin

Tested, looks simple, marking for checkin.

comment:3 Changed 6 years ago by Alex Gaynor

Resolution: fixed
Status: newclosed

Fixed in [14315].

comment:4 Changed 6 years ago by Chris Beaven

(In [14317]) [1.2.X] Fixed #14513 -- check fields with underscores for validity when ordering. Bonus points to Klaas van Schelven.

Backport from trunk (r14315)

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