Ticket #2095: choices.diff
File choices.diff, 836 bytes (added by , 18 years ago) |
---|
-
core/management.py
836 836 if f.prepopulate_from is not None and type(f.prepopulate_from) not in (list, tuple): 837 837 e.add(opts, '"%s": prepopulate_from should be a list or tuple.' % f.name) 838 838 if f.choices: 839 if not type(f.choices) in (tuple, list):840 e.add(opts, '"%s": "choices" should be either a tuple or list.' % f.name)839 if not hasattr(f.choices, '__iter__'): 840 e.add(opts, '"%s": "choices" should be a sequence.' % f.name) 841 841 else: 842 842 for c in f.choices: 843 843 if not type(c) in (tuple, list) or len(c) != 2: