Refactor get_choices_selected

This commit is contained in:
Pablo Martín 2013-11-30 19:57:20 +01:00
parent dd7ff42d24
commit 945f37fddf

View file

@ -60,13 +60,11 @@ class MultiSelectField(models.CharField):
def get_choices_default(self): def get_choices_default(self):
return self.get_choices(include_blank=False) return self.get_choices(include_blank=False)
def get_choices_selected(self, arr_choices=None): def get_choices_selected(self, arr_choices):
if arr_choices is None: choices_selected = []
return False
list = []
for choice_selected in arr_choices: for choice_selected in arr_choices:
list.append(string_type(choice_selected[0])) choices_selected.append(string_type(choice_selected[0]))
return list return choices_selected
def value_to_string(self, obj): def value_to_string(self, obj):
value = self._get_val_from_obj(obj) value = self._get_val_from_obj(obj)