deals_formset_factory = modelformset_factory(Deal, form=DealCForm, extra=1, can_delete=True, max_num=5) deals_formset = deals_formset_factory(queryset=query)
Is there a way to say the one extra form shall always be the first form no matter how many more instance forms are within the deals_formset? I found this bit in the documentation<https://docs.djangoproject.com/en/dev/topics/forms/formsets/#formsets> : Iterating over the formset will render the forms in the order they were created. You can change this order by providing an alternate implementation for the __iter__() method. Formsets can also be indexed into, which returns the corresponding form. If you override __iter__, you will need to also override __getitem__ to have matching behavior. As I am still a bit new to python/django, I don't know where to begin. Is there any short example how __iter__() and __getitem() override have to look like? many Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/2_mvgRg0R-AJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.