#6733: Selected not rendered for SelectMultiple when prefix is present
-------------------------------+--------------------------------------------
          Reporter:  AdamG     |         Owner:  kratorius
            Status:  closed    |     Milestone:  1.0      
         Component:  Forms     |       Version:  SVN      
        Resolution:  invalid   |      Keywords:  forms    
             Stage:  Accepted  |     Has_patch:  1        
        Needs_docs:  0         |   Needs_tests:  0        
Needs_better_patch:  1         |  
-------------------------------+--------------------------------------------
Changes (by kratorius):

  * status:  new => closed
  * resolution:  => invalid

Comment:

 This ticket is invalid. You need to specify the prefix when passing data
 to the form. The provided test case (slightly modified version):
 {{{
 #!python
 CHOICES=[(1, 'one'), (2, 'two')]

 class TestForm(forms.Form):
     number = forms.MultipleChoiceField(choices=CHOICES, required=False)

 data = { 'number': 1 }
 foo = TestForm(data, prefix='mypre')
 }}}

 should be:

 {{{
 #!python
 CHOICES=[(1, 'one'), (2, 'two')]

 class TestForm(forms.Form):
     number = forms.MultipleChoiceField(choices=CHOICES, required=False)

 data = { 'mypre-number': 1 }
 foo = TestForm(data, prefix='mypre')
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/6733#comment:4>
Django Code <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