2

I have a django site with lots of inlines in the admin interface. On the previous version of django that I was using, there was an "Add another" button to add more entries. I upgraded to django 1.6 and this button has disappeared. Here is the relevant part of my admin.py:

class MyInline(admin.TabularInline):
  extra = 0

Note that extra = 0 because I don't want to display anything unless there actually is one or more entry.

I also tried adding max_num = 9999, based on some posts I saw, but that didn't help.

I understand the "Add another" button is implemented with JavaScript. Can anyone explain why the "Add another" button has gone, and more importantly, what I can to do get it back?

Thanks a lot.

smwilsonau
  • 189
  • 1
  • 10
  • Have you tried using `max_num = 0` as stated in this post: http://stackoverflow.com/a/13159832/3540618 – Stack of Pancakes Oct 11 '14 at 02:23
  • The [docs](https://docs.djangoproject.com/en/1.6/ref/contrib/admin/#django.contrib.admin.InlineModelAdmin.extra) say say that it won't show up if the number of forms exceeds the max_num. So it seems odd that when setting it to 9999 it didn't work. – Stack of Pancakes Oct 11 '14 at 02:42
  • Thanks but max_num = 0 didn't fix it. – smwilsonau Oct 11 '14 at 03:43

1 Answers1

3

It turned out that the problem was caused by copying the static admin files from the previous version of my project (from an earlier version of django). Once I recopied the static admin files from the current version, the "Add another" buttons are back.

smwilsonau
  • 189
  • 1
  • 10