diff options
| author | Joseph Kocherhans <joseph@jkocherhans.com> | 2010-02-23 17:30:12 +0000 |
|---|---|---|
| committer | Joseph Kocherhans <joseph@jkocherhans.com> | 2010-02-23 17:30:12 +0000 |
| commit | 0f1769555e1d43ff83f3a715095ac28f24499c2a (patch) | |
| tree | d656749c4d7c95d8f02300f81457a22fe969596e | |
| parent | f2d5582c53f9b667f482842cbb3213db91d35d5e (diff) | |
Fixed #11859. Allowed subclasses of tuple or list for choice options. Thanks, Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12535 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/core/management/validation.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/management/validation.py b/django/core/management/validation.py index 9b65b8ed6c..ddf454ffad 100644 --- a/django/core/management/validation.py +++ b/django/core/management/validation.py @@ -62,7 +62,7 @@ def get_validation_errors(outfile, app=None): e.add(opts, '"%s": "choices" should be iterable (e.g., a tuple or list).' % f.name) else: for c in f.choices: - if not type(c) in (tuple, list) or len(c) != 2: + if not isinstance(c, (list, tuple)) or len(c) != 2: e.add(opts, '"%s": "choices" should be a sequence of two-tuples.' % f.name) if f.db_index not in (None, True, False): e.add(opts, '"%s": "db_index" should be either None, True or False.' % f.name) |
