We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c232d17 commit b7671d6Copy full SHA for b7671d6
multiselectfield/db/fields.py
@@ -65,9 +65,15 @@ def get_choices_default(self):
65
return self.get_choices(include_blank=False)
66
67
def get_choices_selected(self, arr_choices):
68
+ named_groups = arr_choices and isinstance(arr_choices[0][1], (list, tuple))
69
choices_selected = []
- for choice_selected in arr_choices:
70
- choices_selected.append(string_type(choice_selected[0]))
+ if named_groups:
71
+ for choice_group_selected in arr_choices:
72
+ for choice_selected in choice_group_selected[1]:
73
+ choices_selected.append(string_type(choice_selected[0]))
74
+ else:
75
+ for choice_selected in arr_choices:
76
77
return choices_selected
78
79
def value_to_string(self, obj):
0 commit comments