django-nested-inline
django-nested-inline copied to clipboard
add button adds only first level inline
Hi,
Something wrong with my setup. I'm using django 1.4.5 and the lates nested-inline from git. It creates at the start form with nested inlines without any problems. Unfortunately "add new" button doesn't work properly: it adds only first level inline.
It looks like, something incorrect in template: it creates empty-form block for first level inline and creates nothing with empty-form class for nested-inline-row.
I'm not sure if it is the problem, anyway something is incorrect. :)
Can I see your admin and models code?
Sure.
admin.py: http://pastebin.com/t4VS4v6L models.py: http://pastebin.com/9sY3bSmq
any update?
Same problem here!
Any update? @s-block ? Thanks in advance. :D
Has somebody found solution of this problem?
I have added a fix for the tabular template in the latest version of master.
@s-block , I believe I'm still having this issue. The first row of inlines is created on page load, as it should, but their "Add another..." buttons fail to create the child inline.
For example, clicking this button:

... generates this:

... when it should generate this:

I'm running django 1.6.5 with django-nested-inline 0.3.3 . If you can point me to what might be causing this I would be glad to help out as well! Thanks
I experienced a similar issue. My temporary fix was to set extra = 1 for the Inline in the admin. I would prefer to use extra = 0, if someone can fix this problem.
This comment explains the method behind this code: https://code.djangoproject.com/ticket/9025#comment:155
It seems that it just depends on a nested inline already existing before it knows how to make a new one, so I think we're stuck unless we come at it from a different angle than the code in ticket 9025.
The other major package based on 9025 (https://github.com/silverfix/django-nested-inlines) also has this same problem, based on my experience.
Thanks, @natejlong. Your comments remind me of another issue. I had to put my nested inlines at the end of my inlines = [] array to get it to work.
I will hopefully get a chance to look at this in the next few days.
Im getting this when using the same model for my inlines. Because the inline forms will get the same prefix names.
Don't know whats the normal inline behaviour is for this but using a proxy model for each inline should be a workable workaround.