Ticket #11859: validation.diff
File validation.diff, 836 bytes (added by , 15 years ago) |
---|
-
django/core/management/validation.py
58 58 e.add(opts, '"%s": "choices" should be iterable (e.g., a tuple or list).' % f.name) 59 59 else: 60 60 for c in f.choices: 61 if not type(c) in (tuple, list) or len(c) != 2:61 if not (isinstance(c, tuple) or isinstance(c, list)) or len(c) != 2: 62 62 e.add(opts, '"%s": "choices" should be a sequence of two-tuples.' % f.name) 63 63 if f.db_index not in (None, True, False): 64 64 e.add(opts, '"%s": "db_index" should be either None, True or False.' % f.name)