#7771: New validator code breaks ordering of ForeignKey fields
--------------------------------------+-------------------------------------
          Reporter:  Michael P. Jung  |         Owner:  nobody                  
             
            Status:  new              |     Milestone:  1.0                     
             
         Component:  Uncategorized    |       Version:  newforms-admin          
             
        Resolution:                   |      Keywords:  ordering, order_by, 
ForeignKey, r7929
             Stage:  Unreviewed       |     Has_patch:  0                       
             
        Needs_docs:  0                |   Needs_tests:  0                       
             
Needs_better_patch:  0                |  
--------------------------------------+-------------------------------------
Changes (by ramiro):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Old description:

> Revision 7929 adds a validator code that can't handle orderings like
> ('bar__name',):
>
>   (...)
>   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`.

New description:

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

 {{{
   (...)
   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`.
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7771#comment:1>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to