We have a django-model containing a many-to-many field. We use the same form to add/edit objects. When an existing object is loaded for editing all fields have values associated with them except the Many-to-Many field(None of the options is the MultipleSelectBox Widget are selected)
Is there any special way to bind values to Many-to-Many field so that the the current values of the field appear selected in the MultipleSelectBox Widget when the form loads the object for editing.
I tried reading up similar questions put up by users on SO, but couldn’t find the answer to my query :(.
Try To Do This!
This Is My Example To Show You How Can You Do It 😀
After You save It In Your add Function, Then To Edit It In edit Function, Do This:
That’s It 😀