Ticket #1697: iterable.diff
File iterable.diff, 849 bytes (added by , 19 years ago) |
---|
-
management.py
822 822 if f.prepopulate_from is not None and type(f.prepopulate_from) not in (list, tuple): 823 823 e.add(opts, '"%s": prepopulate_from should be a list or tuple.' % f.name) 824 824 if f.choices: 825 if not type(f.choices) in (tuple, list):826 e.add(opts, '"%s": "choices" should be either a tuple or list.' % f.name)825 if not hasattr(f.choices, '__iter__'): 826 e.add(opts, '"%s": "choices" needs to be an iterable such as a list or tuple.' % f.name) 827 827 else: 828 828 for c in f.choices: 829 829 if not type(c) in (tuple, list) or len(c) != 2: