Fix #1 now works if the first composant of the list of tuple is an integer
This commit is contained in:
parent
16e56f6177
commit
bdf660c561
|
@ -45,12 +45,9 @@ def add_metaclass(metaclass):
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
|
|
||||||
class MultiSelectField(models.Field):
|
class MultiSelectField(models.CharField):
|
||||||
""" Choice values can not contain commas. """
|
""" Choice values can not contain commas. """
|
||||||
|
|
||||||
def get_internal_type(self):
|
|
||||||
return "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)
|
||||||
|
|
||||||
|
@ -59,7 +56,7 @@ class MultiSelectField(models.Field):
|
||||||
return False
|
return False
|
||||||
list = []
|
list = []
|
||||||
for choice_selected in arr_choices:
|
for choice_selected in arr_choices:
|
||||||
list.append(choice_selected[0])
|
list.append(string_type(choice_selected[0]))
|
||||||
return list
|
return list
|
||||||
|
|
||||||
def _get_FIELD_display(self, field):
|
def _get_FIELD_display(self, field):
|
||||||
|
|
Loading…
Reference in a new issue