Re: [Django] #15106: label[for] attributes aren't updated when dynamically creating new inlines

2011-01-24 Thread Django
#15106: label[for] attributes aren't updated when dynamically creating new 
inlines
---+
  Reporter:  mk| Owner:  nobody
Status:  closed| Milestone:  1.3   
 Component:  django.contrib.admin  |   Version:  1.2   
Resolution:  duplicate |  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by ramiro):

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

Comment:

 Duplicate of #13674, it has a simpler patch attached, and the fix
 suggested by the OP there is very similar to the one proposed here.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15106: label[for] attributes aren't updated when dynamically creating new inlines

2011-01-21 Thread Django
#15106: label[for] attributes aren't updated when dynamically creating new 
inlines
---+
  Reporter:  mk| Owner:  nobody
Status:  new   | Milestone:  1.3   
 Component:  django.contrib.admin  |   Version:  1.2   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by mk):

 Both problems affect the inline javascript code, but the issues are
 different.

 As I understand it, #14830 covers the problem that
 input[type=radio] elements are inserted too early into the DOM (before all
 IDs and NAMEs are changed). This ticket covers the problem that not all
 attributes which should be unique are updated properly, in this case the
 FOR attribute of label tags.

 Maybe both bugs should be resolved at the same time, but that's not for me
 to decide.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15106: label[for] attributes aren't updated when dynamically creating new inlines

2011-01-20 Thread Django
#15106: label[for] attributes aren't updated when dynamically creating new 
inlines
---+
  Reporter:  mk| Owner:  nobody
Status:  new   | Milestone:  1.3   
 Component:  django.contrib.admin  |   Version:  1.2   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by ramiro):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 Could this be solved with an approach similar to the one proposed in
 #14830 ?

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #15106: label[for] attributes aren't updated when dynamically creating new inlines

2011-01-18 Thread Django
#15106: label[for] attributes aren't updated when dynamically creating new 
inlines
--+-
 Reporter:  mk|   Owner:  nobody
   Status:  new   |   Milestone:  1.3   
Component:  django.contrib.admin  | Version:  1.2   
 Keywords:|   Stage:  Unreviewed
Has_patch:  1 |  
--+-
 Processing for attributes too in inlines.js, addButton click handler fixes
 the problem.

 Something like this:

 {{{

 diff --git a/django/contrib/admin/media/js/inlines.js
 b/django/contrib/admin/media/js/inlines.js
 index cf79023..d9dc9cb 100644
 --- a/django/contrib/admin/media/js/inlines.js
 +++ b/django/contrib/admin/media/js/inlines.js
 @@ -71,6 +71,14 @@
 .end()
 .filter(function() {
 var el = $(this);
 +   return el.attr("for") &&
 el.attr("for").search(/__prefix__/) >= 0;
 +   }).each(function() {
 +   var el = $(this);
 +   el.attr("for",
 el.attr("for").replace(/__prefix__/g, nextIndex));
 +   })
 +   .end()
 +   .filter(function() {
 +   var el = $(this);
 return el.attr("name") &&
 el.attr("name").search(/__prefix__/) >= 0;
 }).each(function() {
 var el = $(this);
 }}}


 I'm not sure whether this is the best way to fix it, though. Processing a
 list of elements six times instead of once does not seem to make much
 sense to me.

 This code isn't performance critical, though.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.