Re: Ticket 13023: Admin inlines, max_num, and extra

2010-05-10 Thread Rolando Espinoza La Fuente
There is a small issue related to max_num and js-hide functionality. I've just opened a new ticket http://code.djangoproject.com/ticket/13521 tl;dr: if ((maxForms.val() != '') && (maxForms.val() <= totalForms.val())) { val() function returns a string, resulting "10" <= "2" which is True in

Re: Ticket 13023: Admin inlines, max_num, and extra

2010-03-21 Thread Gabriel Hurley
I've added an all-new patch to #13023 that encompasses everything discussed in this thread. It makes max_num default to None instead of 0. This makes the meaning of max_num clearer as per Russ above, and makes the behavior of the dynamic "Add Another" admin inline link fall into line with the no-

Re: Ticket 13023: Admin inlines, max_num, and extra

2010-03-18 Thread Gabriel Hurley
Thanks for a great reply Russ. I agree 100% about interpretation 3 being the most useful and beneficial. The first concern about the original use case is something I'd considered, but I don't think it can be helped without creating an ugly hack (like my original patch on the ticket). The change

Re: Ticket 13023: Admin inlines, max_num, and extra

2010-03-18 Thread Russell Keith-Magee
Hi Gabriel Sorry for taking so long to get back to you on this. I certainly appreciate the effort you've put into the analysis. On Fri, Mar 19, 2010 at 6:03 AM, Gabriel Hurley wrote: > There are two possible solutions, as I see it: > > 1. Change the default value of max_num

Re: Ticket 13023: Admin inlines, max_num, and extra

2010-03-18 Thread Gabriel Hurley
There are two possible solutions, as I see it: 1. Change the default value of max_num from 0 to -1. That's a pretty standard solution to indicating an "off" value for something with a range of [0, ∞]. That way when max_num and extra are *both* explicitly set to 0, the "Add Another" link could be

Re: Ticket 13023: Admin inlines, max_num, and extra

2010-03-16 Thread Gabriel Hurley
Thanks for the IRC log, Ivan. That offers some perspective. Ideally a complete solution would have the following characteristics: 1. Makes behavior consistent with or without Javascript enabled. I personally would argue against any solution that caused extra and max_num to have different effects

Re: Ticket 13023: Admin inlines, max_num, and extra

2010-03-16 Thread Iván Raskovsky
Hi Gabriel, here's a follow up after I asked in django-dev if I should file the ticket: http://botland.oebfare.com/logger/django-dev/2010/3/4/1/ Unfortunately I can't find my original conversation. One thing that might be important to take into consideration is that without the patch users

Ticket 13023: Admin inlines, max_num, and extra

2010-03-16 Thread Gabriel Hurley
I couldn't help notice that #13023 was mentioned in Russ' latest 1.2 status update as a ticket that "will require some significant design work". Since I've accepted that ticket I'd love to get some feedback from folks. The ticket: http://code.djangoproject.com/ticket/13023 The ticket was opened