Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Unroll choices iterators in field deconstruction

  • Loading branch information...
commit f5f556dba3c89333d4533e0603de79b62083d807 1 parent 2a30b39
@andrewgodwin andrewgodwin authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 django/db/models/fields/
4 django/db/models/fields/
@@ -329,6 +329,10 @@ def deconstruct(self):
equals_comparison = set(["choices", "validators", "db_tablespace"])
for name, default in possibles.items():
value = getattr(self, attr_overrides.get(name, name))
+ # Unroll anything iterable for choices into a concrete list
+ if name == "choices" and isinstance(value, collections.Iterable):
+ value = list(value)
+ # Do correct kind of comparison
if name in equals_comparison:
if value != default:
keywords[name] = value

0 comments on commit f5f556d

Please sign in to comment.
Something went wrong with that request. Please try again.