#11859: Change type checking condition in validation of choices
------------------------------------------+---------------------------------
   Reporter:  paluh                       |                Owner:  nobody    
     Status:  new                         |            Milestone:            
  Component:  Core framework              |              Version:  SVN       
   Keywords:  model, validation, choices  |                Stage:  Unreviewed
  Has_patch:  1                           |           Needs_docs:  0         
Needs_tests:  0                           |   Needs_better_patch:  0         
------------------------------------------+---------------------------------
 I want to use instance of tuple subclass (instead of tuple instance) in
 IntegerField choices initialization. It's impossible because in
 core/management/validation.py (line 62) there is condition:

 {{{
 if not type(c) in (tuple, list) or len(c) != 2:
 }}}

 Can it be changed to:

 {{{
 if not (isinstance(c, tuple) or isinstance(c, list)) or len(c) != 2:
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/11859>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to