On Fri, Apr 10, 2020 at 10:40 PM אורי <
u...@speedy.net> wrote:
> In this form I need to insert fields in the beginning of the form, and therefore I call move_to_end. It worked with Django 2.2 but not with 3.0 because this method is not defined in a dict. So I think if you revert to using OrderedDict, users will be able to use this method to insert fields in the beginning, or change the order of fields. So I think it was a mistake changing it to a dict.
Reordering the fields of a form is a use case that already has supported API:
https://docs.djangoproject.com/en/3.0/ref/forms/api/#notes-on-field-ordering
You can either set the field_order attribute explicitly to the order
you want, or call the order_fields() method and pass in the new order.
Manually manipulating the underlying fields dict was never a
documented (and thus never a supported) feature of forms. If you need
to reorder fields, please just use the documented and supported API
for this.