django-nested-inline
django-nested-inline copied to clipboard
"object has no attribute 'inlines'" when having multiple inlines for a admin model form
The error occurs at "nested_inline/admin.py in add_view" line 178 when trying to save an object.
As an example I have these lines:
inlines = (CaseStudyTextBlockInline, CaseStudyFullWidthImageInline, CaseStudyVideoInline,
CaseStudyImageSliderInline)
And the error is "'CaseStudyTextBlockInline' object has no attribute 'inlines'".
Am I doing something wrong?
Just add an empty inlines attributes in your 'classic' Inlines classes, should work fine then.
Or just use a try/except.
Same here! It was the @marcoooo a valid solution? Reading the docs, the last level "Inline" doesn't have any inlines attribute... It's weird because I've got two classes that inherit from NestedModel, one works and the other one don't...
@marcoooo 's answer worked for me, but I am not sure if this should be the valid solution