Re: [Django] #13674: Javascript for adding inline fields doesn't update "for" attribute in label

2011-02-04 Thread Django
#13674: Javascript for adding inline fields doesn't update "for" attribute in 
label
+---
   Reporter:  Jonas | Owner:  rctay
 Status:  new   | Milestone:  1.3  
  Component:  django.contrib.admin  |   Version:  1.2  
 Resolution:|  Keywords:  admin
   Triage Stage:  Ready for checkin | Has patch:  1
Needs documentation:  0 |   Needs tests:  0
Patch needs improvement:  1 |  
+---
Changes (by julien):

  * stage:  Accepted => Ready for checkin


Comment:

 Thanks for spotting this issue, Russ  - and sorry for having missed it.
 I've attached a patch which should fix the root problem. Taking the
 liberty to RFC again so it gets on your radar for the 1.3 home stretch.

-- 
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] #13674: Javascript for adding inline fields doesn't update "for" attribute in label

2011-02-04 Thread Django
#13674: Javascript for adding inline fields doesn't update "for" attribute in 
label
+---
   Reporter:  Jonas | Owner:  rctay
 Status:  new   | Milestone:  1.3  
  Component:  django.contrib.admin  |   Version:  1.2  
 Resolution:|  Keywords:  admin
   Triage Stage:  Accepted  | Has patch:  1
Needs documentation:  0 |   Needs tests:  0
Patch needs improvement:  1 |  
+---
Changes (by russellm):

  * needs_better_patch:  0 => 1
  * stage:  Ready for checkin => Accepted


Comment:

 Patch applies and fixes the bug, but introduces a different bug -newly
 created inlines don't validate.

 To reproduce:
  * Use a parent model with a TabularInline child, with extra=3
  * apply patch 0001
  * Add a new parent object
  * Add 1 extra inline row
  * Populate all 4 inline objects (the 3 default provided, plus the 1 added
 inline).
  * Try to save the object

 The object will fail validation, and lose the data for the fourth inline.
 If you re-enter and save, the data is saved successfully.

-- 
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] #13674: Javascript for adding inline fields doesn't update "for" attribute in label

2011-01-25 Thread Django
#13674: Javascript for adding inline fields doesn't update "for" attribute in 
label
---+
  Reporter:  Jonas | Owner:  rctay
Status:  new   | Milestone:  1.3  
 Component:  django.contrib.admin  |   Version:  1.2  
Resolution:|  Keywords:  admin
 Stage:  Ready for checkin | Has_patch:  1
Needs_docs:  0 |   Needs_tests:  0
Needs_better_patch:  0 |  
---+
Changes (by julien):

  * stage:  Accepted => Ready for checkin

Comment:

 The patch applies and fixes this bug. See also #14303 for a related (but
 different) bug.

-- 
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] #13674: Javascript for adding inline fields doesn't update "for" attribute in label

2011-01-24 Thread Django
#13674: Javascript for adding inline fields doesn't update "for" attribute in 
label
---+
  Reporter:  Jonas | Owner:  rctay
Status:  new   | Milestone:  1.3  
 Component:  django.contrib.admin  |   Version:  1.2  
Resolution:|  Keywords:  admin
 Stage:  Accepted  | Has_patch:  1
Needs_docs:  0 |   Needs_tests:  0
Needs_better_patch:  0 |  
---+
Comment (by ramiro):

 #15106 was a duplicate and contained a pattch similar to the fix suggested
 by the OP of this ticket.

-- 
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] #13674: Javascript for adding inline fields doesn't update "for" attribute in label

2010-07-03 Thread Django
#13674: Javascript for adding inline fields doesn't update "for" attribute in 
label
---+
  Reporter:  Jonas | Owner:  rctay
Status:  new   | Milestone:  1.3  
 Component:  django.contrib.admin  |   Version:  1.2  
Resolution:|  Keywords:  admin
 Stage:  Accepted  | Has_patch:  1
Needs_docs:  0 |   Needs_tests:  0
Needs_better_patch:  0 |  
---+
Changes (by rctay):

  * owner:  nobody => rctay

-- 
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-upda...@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] #13674: Javascript for adding inline fields doesn't update "for" attribute in label

2010-07-03 Thread Django
#13674: Javascript for adding inline fields doesn't update "for" attribute in 
label
---+
  Reporter:  Jonas | Owner:  nobody
Status:  new   | Milestone:  1.3   
 Component:  django.contrib.admin  |   Version:  1.2   
Resolution:|  Keywords:  admin 
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by rctay):

 Attached a patch for both the full and minified JS files.

 Note that apart from changing the regex to search for {{{__prefix___}}}
 instead of a number ({{{\d+}}}), the capturing parentheses {{{()}}} has
 also been removed, since we don't need the matched result.

-- 
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-upda...@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] #13674: Javascript for adding inline fields doesn't update "for" attribute in label

2010-07-03 Thread Django
#13674: Javascript for adding inline fields doesn't update "for" attribute in 
label
---+
  Reporter:  Jonas | Owner:  nobody
Status:  new   | Milestone:  1.3   
 Component:  django.contrib.admin  |   Version:  1.2   
Resolution:|  Keywords:  admin 
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by rctay):

 Replying to [ticket:13674 Jonas]:
 > This is the patch that solved it for me:
 >
 > {{{
 > diff --git a/django/contrib/admin/media/js/inlines.js
 b/django/contrib/admin/media/js/inlines.js
 > index cf79023..90b50b5 100644
 > --- a/django/contrib/admin/media/js/inlines.js
 > +++ b/django/contrib/admin/media/js/inlines.js
 > @@ -75,6 +75,14 @@
 > }).each(function() {
 > var el = $(this);
 > el.attr("name",
 el.attr("name").replace(/__prefix__/g, nextIndex));
 > +   })
 > +   .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));
 > });
 > if (row.is("tr")) {
 > // If the forms are laid out in
 table rows, insert
 > }}}

 You should be modifying {{{updateElementIndex()}}} instead - it will be
 much cleaner.

 {{{
 diff --git a/django/contrib/admin/media/js/inlines.js
 b/django/contrib/admin/media/js/inlines.js
 index cf79023..21e00ad 100644
 --- a/django/contrib/admin/media/js/inlines.js
 +++ b/django/contrib/admin/media/js/inlines.js
 @@ -18,7 +18,7 @@
 $.fn.formset = function(opts) {
 var options = $.extend({}, $.fn.formset.defaults, opts);
 var updateElementIndex = function(el, prefix, ndx) {
 -   var id_regex = new RegExp("(" + prefix +
 "-\\d+)");
 +   var id_regex = new RegExp(prefix + "-__prefix__");
 var replacement = prefix + "-" + ndx;
 if ($(el).attr("for")) {
 $(el).attr("for",
 $(el).attr("for").replace(id_regex, replacement));
 }}}

-- 
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-upda...@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] #13674: Javascript for adding inline fields doesn't update "for" attribute in label

2010-06-17 Thread Django
#13674: Javascript for adding inline fields doesn't update "for" attribute in 
label
---+
  Reporter:  Jonas | Owner:  nobody
Status:  new   | Milestone:  1.3   
 Component:  django.contrib.admin  |   Version:  1.2   
Resolution:|  Keywords:  admin 
 Stage:  Accepted  | Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * needs_better_patch:  => 0
  * component:  Uncategorized => django.contrib.admin
  * needs_tests:  => 0
  * milestone:  => 1.3
  * needs_docs:  => 0
  * 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 post to this group, send email to django-upda...@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] #13674: Javascript for adding inline fields doesn't update "for" attribute in label

2010-06-01 Thread Django
#13674: Javascript for adding inline fields doesn't update "for" attribute in 
label
---+
 Reporter:  Jonas  |   Owner:  nobody
   Status:  new|   Milestone:
Component:  Uncategorized  | Version:  1.2   
 Keywords:  admin  |   Stage:  Unreviewed
Has_patch:  1  |  
---+
 I do some checking for required fields using Javascript in the admin.
 Doing that, I noticed that adding inline fields doesn't update the "for"
 attribute for the new  fields. If the field is called "image", the
 newly added field label looks like this:

 {{{
 Image:
 }}}

 This is the patch that solved it for me:

 {{{
 diff --git a/django/contrib/admin/media/js/inlines.js
 b/django/contrib/admin/media/js/inlines.js
 index cf79023..90b50b5 100644
 --- a/django/contrib/admin/media/js/inlines.js
 +++ b/django/contrib/admin/media/js/inlines.js
 @@ -75,6 +75,14 @@
 }).each(function() {
 var el = $(this);
 el.attr("name",
 el.attr("name").replace(/__prefix__/g, nextIndex));
 +   })
 +   .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));
 });
 if (row.is("tr")) {
 // If the forms are laid out in
 table rows, insert
 }}}

-- 
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-upda...@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.