#5665: Form instances with MultipleChoiceField share choices
-------------------------------+--------------------------------------------
Reporter:  [EMAIL PROTECTED]  |       Owner:  nobody             
  Status:  new                 |   Component:  django.newforms    
 Version:  0.96                |    Keywords:  MultipleChoiceField
   Stage:  Unreviewed          |   Has_patch:  0                  
-------------------------------+--------------------------------------------
 If I create two instances of a form with a MultipleChoiceField, and then
 change the choices on one of them, the choices are also changed on the
 other :
 {{{
 In [2]: import django.newforms as forms

 In [3]: class MyForm(forms.Form):
    ...:     x = forms.MultipleChoiceField()
    ...:
    ...:

 In [4]: f = MyForm()

 In [5]: f2 = MyForm()

 In [6]: f2.as_p()
 Out[6]: u'<p><label for="id_x">X:</label> <select multiple="multiple"
 name="x" id="id_x">\n</select></p>'

 In [7]: f.fields['x'].choices = [('1','1')]

 In [8]: f2.as_p()
 Out[8]: u'<p><label for="id_x">X:</label> <select multiple="multiple"
 name="x" id="id_x">\n<option value="1">1</option>\n</select></p>'
 }}}
 Surely changing the choices in f should not affect f2 ?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5665>
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