#10512: Ordering of non-model fields in a ModelForm, after #8164
-------------------------------+--------------------------------------------
          Reporter:  mbi       |         Owner:  Alex                  
            Status:  new       |     Milestone:                        
         Component:  Forms     |       Version:  SVN                   
        Resolution:            |      Keywords:  modelform, field order
             Stage:  Accepted  |     Has_patch:  1                     
        Needs_docs:  0         |   Needs_tests:  1                     
Needs_better_patch:  0         |  
-------------------------------+--------------------------------------------
Comment (by korpios):

 `fields_for_model` is actually the wrong place to be sorting; you want to
 do that in `ModelFormMetaclass.__new__`, otherwise you'll miss sorting
 entirely on fields from `declared_fields`.  Just reassign
 `fields.keyOrder`, e.g.:
 {{{
         if opts.fields:
             fields.keyOrder = [f for f in opts.fields if f in
 fields.keyOrder]
 }}}
 But, yeah — the changes in r10062 made things go breaky over here.  `^_^`

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10512#comment:3>
Django <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 django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to