Re: [Django] #27369: Multiple form fields can share the same widget instance

2016-11-06 Thread Django
#27369: Multiple form fields can share the same widget instance
-+-
 Reporter:  Michal Petrucha  |Owner:  Michal
 |  Petrucha
 Type:  Bug  |   Status:  closed
Component:  Forms|  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"09da1e79de5a03a63610822bd4e5fc2adcbeb38a" 09da1e79]:
 {{{
 #!CommitTicketReference repository=""
 revision="09da1e79de5a03a63610822bd4e5fc2adcbeb38a"
 Fixed #27369 -- Prevented widgets from being shared between form field
 instances.
 }}}

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.7abf936adbbd53220b43a8e1aef04dcb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27369: Multiple form fields can share the same widget instance

2016-10-26 Thread Django
#27369: Multiple form fields can share the same widget instance
-+-
 Reporter:  Michal Petrucha  |Owner:  Michal
 |  Petrucha
 Type:  Bug  |   Status:  assigned
Component:  Forms|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * stage:  Accepted => Ready for checkin


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.40b518d56e10624537bb3ff8fc5720d8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27369: Multiple form fields can share the same widget instance

2016-10-25 Thread Django
#27369: Multiple form fields can share the same widget instance
-+-
 Reporter:  Michal Petrucha  |Owner:  Michal
 |  Petrucha
 Type:  Bug  |   Status:  assigned
Component:  Forms|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Jaap Roes):

 Replying to [comment:1 Michal Petrucha]:
 > [https://github.com/django/django/pull/6267 PR]

 This links to the wrong PR (#6267), the correct one is this
 [https://github.com/django/django/pull/7415 PR #7415]

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.1ab60b1c29fa7c91af0e90a39bea13a4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27369: Multiple form fields can share the same widget instance

2016-10-22 Thread Django
#27369: Multiple form fields can share the same widget instance
-+-
 Reporter:  Michal Petrucha  |Owner:  Michal
 |  Petrucha
 Type:  Bug  |   Status:  assigned
Component:  Forms|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * stage:  Unreviewed => Accepted


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.e170d0d3962d0d44b87a281f8e5a2047%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27369: Multiple form fields can share the same widget instance

2016-10-20 Thread Django
#27369: Multiple form fields can share the same widget instance
-+-
 Reporter:  Michal Petrucha  |Owner:  Michal
 |  Petrucha
 Type:  Bug  |   Status:  assigned
Component:  Forms|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Michal Petrucha):

 * needs_better_patch:   => 0
 * has_patch:  0 => 1
 * needs_tests:   => 0
 * needs_docs:   => 0


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.5871d813e8d52e4631f07493f5f2bd65%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #27369: Multiple form fields can share the same widget instance

2016-10-20 Thread Django
#27369: Multiple form fields can share the same widget instance
-+-
 Reporter:  Michal Petrucha  |  Owner:  Michal Petrucha
 Type:  Bug  | Status:  assigned
Component:  Forms|Version:  master
 Severity:  Normal   |   Keywords:
 Triage Stage:  Unreviewed   |  Has patch:  0
Easy pickings:  0|  UI/UX:  0
-+-
 Say we have a custom form field that defines a certain HTML class on its
 widget:
 {{{#!python
 class CustomChoiceField(ChoiceField):
 widget = Select(attrs={'class': 'my-custom-class'})
 }}}
 If this field type is used for multiple fields in the same form, they will
 all share the same widget instance. This leads to conflicts when setting
 the fields' choices; since they all use the same widget instance, all
 fields will render the same choices from the widget even though the fields
 themselves might have different choices. The following test case fails,
 for example:
 {{{#!python
 class TestForm(Form):
 field1 = CustomChoiceField(choices=[])
 field2 = CustomChoiceField(choices=[])

 f = TestForm()
 f.fields['field1'].choices = [("1", "1")]
 f.fields['field2'].choices = [("2", "2")]
 assert f.fields['field1'].widget.choices == [("1", "1")]
 assert f.fields['field2'].widget.choices == [("2", "2")]
 }}}

 I took a deep dive, and found out that since the field instances
 themselves share the widget instance (as it's a class attribute that
 doesn't need to get instantiated in each field instance), when fields are
 getting deepcopied in `BaseForm.__init__`, their copies all share one new
 copy of the widget instance.

 This is quite easy to fix by deepcopying the widget in the case where it
 was specified as an instance, rather than a widget class. Patch coming up
 in a couple of minutes.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.9dd85576c2abbe3a3a5f1fb1c3301290%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.