mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -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) |                     e.add(opts, '"%s": "choices" should be iterable (e.g., a tuple or list).' % f.name) | ||||||
|                 else: |                 else: | ||||||
|                     for c in f.choices: |                     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) |                             e.add(opts, '"%s": "choices" should be a sequence of two-tuples.' % f.name) | ||||||
|             if f.db_index not in (None, True, False): |             if f.db_index not in (None, True, False): | ||||||
|                 e.add(opts, '"%s": "db_index" should be either None, True or False.' % f.name) |                 e.add(opts, '"%s": "db_index" should be either None, True or False.' % f.name) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user