Loading django/db/models/fields/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -304,7 +304,7 @@ class Field(object): """Flattened version of choices tuple.""" flat = [] for choice, value in self.choices: if type(value) in (list, tuple): if isinstance(value, (list, tuple)): flat.extend(value) else: flat.append((choice,value)) Loading django/forms/fields.py +1 −1 Original line number Diff line number Diff line Loading @@ -660,7 +660,7 @@ class ChoiceField(Field): def valid_value(self, value): "Check to see if the provided value is a valid choice" for k, v in self.choices: if type(v) in (tuple, list): if isinstance(v, (list, tuple)): # This is an optgroup, so look inside the group for options for k2, v2 in v: if value == smart_unicode(k2): Loading Loading
django/db/models/fields/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -304,7 +304,7 @@ class Field(object): """Flattened version of choices tuple.""" flat = [] for choice, value in self.choices: if type(value) in (list, tuple): if isinstance(value, (list, tuple)): flat.extend(value) else: flat.append((choice,value)) Loading
django/forms/fields.py +1 −1 Original line number Diff line number Diff line Loading @@ -660,7 +660,7 @@ class ChoiceField(Field): def valid_value(self, value): "Check to see if the provided value is a valid choice" for k, v in self.choices: if type(v) in (tuple, list): if isinstance(v, (list, tuple)): # This is an optgroup, so look inside the group for options for k2, v2 in v: if value == smart_unicode(k2): Loading