Opened 14 years ago

Closed 14 years ago

Last modified 14 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: no UI/UX: no

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 14 years ago.
Patch

Download all attachments as: .zip

Change History (5)

by Klaas van Schelven, 14 years ago

Patch

comment:2 by Łukasz Rekucki, 14 years ago

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

Tested, looks simple, marking for checkin.

comment:3 by Alex Gaynor, 14 years ago

Resolution: fixed
Status: newclosed

Fixed in [14315].

comment:4 by Chris Beaven, 14 years ago

(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