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

3 views
Skip to first unread message

Klaas van Schelven

unread,
Oct 20, 2010, 6:43:31 AM10/20/10
to Django developers
Hi,

I'm not sure I'm following protocol here, but here it goes...

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:

Good luck,
Klaas

Russell Keith-Magee

unread,
Oct 20, 2010, 7:05:05 AM10/20/10
to django-d...@googlegroups.com
On Wed, Oct 20, 2010 at 6:43 PM, Klaas van Schelven
<klaasvan...@gmail.com> wrote:
> Hi,
>
> I'm not sure I'm following protocol here, but here it goes...

The best way to report this is to open a ticket [1] which describes
the problem in detail (which is what you've done here). This ensure
that we have a formal way of tracking that the issue exists, when it
is resolved, etc.

For bonus points, if you're able to generate a source code diff that
contains the fix you propose, that will make it easier for us to make
the change.

For double bonus points, if your diff includes a test case that
verifies the problem exists, and that your patch fixes it, you make it
very easy for us to make the change.

Tests for model validation usually live in
tests/modeltests/invalid_models, which is a list of models known to
have model problems, followed by a list of the problems that Django
reports.

[1] http://code.djangoproject.com/simpleticket

Yours,
Russ Magee %-)

Klaas van Schelven

unread,
Oct 20, 2010, 1:01:56 PM10/20/10
to Django developers
http://code.djangoproject.com/ticket/14513

Now give me my bonus points :-)

On Oct 20, 1:05 pm, Russell Keith-Magee <russ...@keith-magee.com>
wrote:
> On Wed, Oct 20, 2010 at 6:43 PM, Klaas van Schelven
>
Reply all
Reply to author
Forward
0 new messages