I have a form with one field that keeps only the name of family members. I want user be able to change the order as the user wishes.
The current order is the order of their creation. I found the flag can_order for my formset; when I add it to my formset, another field appeared besides the names and that field is an integer showing the number in the list.
class FamilyMemebrsNameForm(forms.Form):
name= forms.CharField(label=_('name'), max_length=250)
FamilyMemberNameItem = formset_factory(
FamilyMemebrsNameForm, can_delete=True, can_order=True)
My question is: can I change the order of the forms (the names of family members) by playing with this number? If yes, how should I do that?