#5986: Easy way to customize ordering of fields on forms that use inheritance
-------------------------------------+-------------------------------------
     Reporter:  emes                 |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Forms                |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  field order weight   |             Triage Stage:  Accepted
  form newforms                      |      Needs documentation:  0
    Has patch:  1                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by alasdairnicol):

 Replying to [comment:27 loic]:
 > Can't say I'm convinced with this ticket, IMO ordering fields belongs in
 the templates.

 I used `self.field.keyOrder` in previous versions of Django, and would
 find an official API useful. If you render the form in the template with
 `{{ form }}` or `{{ form.ul }}`, then it's much easier to change the field
 order in the form than the template.

 The
 [https://github.com/django/django/blob/1.7/django/contrib/auth/forms.py#L338
 PasswordChangeForm] in the contrib.auth app changes the field order by
 changing base_fields. I think it's much better to change it there than to
 tell users to put 'old password' before 'new password' in their template.
 It would be even better if we used a public API to change the field order.

--
Ticket URL: <https://code.djangoproject.com/ticket/5986#comment:28>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/062.773b7bb841218c99c272ffa89ba95750%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to