Re: [Django] #14303: admin inline form id attribute numbering order and uniqueness is lost

2011-02-01 Thread Django
#14303: admin inline form id attribute numbering order and uniqueness is lost
+---
   Reporter:  m0nonoke  | Owner:  nobody
  
 Status:  new   | Milestone:  1.3   
  
  Component:  django.contrib.admin  |   Version:  SVN   
  
 Resolution:|  Keywords:  inline 
javascript, sprintdec2010
   Triage Stage:  Ready for checkin | Has patch:  1 
  
Needs documentation:  0 |   Needs tests:  0 
  
Patch needs improvement:  0 |  
+---
Changes (by julien):

  * stage:  Accepted => Ready for checkin


Comment:

 RFC'ing my own patch but hopefully this is a simple-enough fix to allow me
 to do that :)

-- 
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] #14303: admin inline form id attribute numbering order and uniqueness is lost

2011-01-25 Thread Django
#14303: admin inline form id attribute numbering order and uniqueness is lost
---+
  Reporter:  m0nonoke  | Owner:  nobody 
 
Status:  new   | Milestone:  1.3
 
 Component:  django.contrib.admin  |   Version:  SVN
 
Resolution:|  Keywords:  inline javascript, 
sprintdec2010
 Stage:  Accepted  | Has_patch:  1  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Comment (by julien):

 See #13674 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] #14303: admin inline form id attribute numbering order and uniqueness is lost

2010-12-04 Thread Django
#14303: admin inline form id attribute numbering order and uniqueness is lost
---+
  Reporter:  m0nonoke  | Owner:  nobody 
 
Status:  new   | Milestone:  1.3
 
 Component:  django.contrib.admin  |   Version:  SVN
 
Resolution:|  Keywords:  inline javascript, 
sprintdec2010
 Stage:  Accepted  | Has_patch:  1  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Changes (by julien):

  * keywords:  inline javascript => inline javascript, sprintdec2010
  * has_patch:  0 => 1
  * stage:  Unreviewed => Accepted

Comment:

 I confirm this is a bug. This can be fixed by keeping `nextIndex` static
 and not refreshing it with the TOTAL_FORMS value each time. See patch
 attached.

-- 
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] #14303: admin inline form id attribute numbering order and uniqueness is lost

2010-09-17 Thread Django
#14303: admin inline form id attribute numbering order and uniqueness is lost
---+
  Reporter:  m0nonoke  | Owner:  nobody   
Status:  new   | Milestone:  1.3  
 Component:  django.contrib.admin  |   Version:  SVN  
Resolution:|  Keywords:  inline javascript
 Stage:  Unreviewed| Has_patch:  0
Needs_docs:  0 |   Needs_tests:  0
Needs_better_patch:  0 |  
---+
Changes (by m0nonoke):

  * needs_better_patch:  => 0
  * 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 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] #14303: admin inline form id attribute numbering order and uniqueness is lost

2010-09-17 Thread Django
#14303: admin inline form id attribute numbering order and uniqueness is lost
--+-
 Reporter:  m0nonoke  |   Owner:  nobody
   Status:  new   |   Milestone:  1.3   
Component:  django.contrib.admin  | Version:  SVN   
 Keywords:  inline javascript |   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 Inline forms that are added using the "Add another ..." button created by
 contrib/admin/media/js/inlines.js lose their id attribute ordering and
 uniqueness if they are deleted out of reverse order.

 To demonstrate the effect take the following steps:

 1. Create an admin form eg. MyAdmin with a tabular inline form eg.
 MyInline.

 2. Add 3 or more inline forms using the "Add another MyInline button"

 3. The HTML for the formset looks something like  where myinline_set is the prefix. For 4
 forms the ids are therefore myinline_set-0, myinline_set-1,
 myinline_set-2, myinline_set-3.

 4. Delete the second form using the delete link. The ids are now
 myinline_set-0, myinline_set-2, myinline_set-3.

 5. Add another inline using the "Add another MyInline button". The ids now
 show The ids are now myinline_set-0, myinline_set-2, myinline_set-3,
 myinline_set-3.


 It looks like the problem occurs because of the way the id is computed in
 contrib/admin/media/js/inlines.js.
 {{{
 # contrib/admin/media/js/inlines.js Line 59-62
 59 row.removeClass(options.emptyCssClass)
 60.addClass(options.formCssClass)
 61.attr("id", options.prefix + "-" + nextIndex)
 62.insertBefore($(template));
 }}}

 nextIndex is just the TOTAL_FORMS value of the management form plus one.
 The solution would involve resetting the values for all inline forms.

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