Opened 16 years ago

Last modified 13 years ago

#7771 closed

New validator code breaks ordering of ForeignKey fields — at Initial Version

Reported by: Michael P. Jung Owned by: nobody
Component: Uncategorized Version: newforms-admin
Severity: Keywords: ordering, order_by, ForeignKey, r7929
Cc: mpjung@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Revision 7929 adds a validator code that can't handle orderings like ('barname',):

(...)
File "django/contrib/admin/sites.py", line 81, in register

validate(admin_class, model)

File "django/contrib/admin/validation.py", line 84, in validate

_check_field_existsw('ordering[%d]' % idx, field)

File "django/contrib/admin/validation.py", line 25, in _check_field_existsw

return _check_field_exists(cls, model, opts, label, field)

File "django/contrib/admin/validation.py", line 243, in _check_field_exists

% (cls.name, label, field, model.name))

django.core.exceptions.ImproperlyConfigured: Foo_Options.ordering[0] refers to field bar__name that is missing from model Foo.

Change History (0)

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