Open piranna opened 9 months ago
Hi! Thanks for opening an issue! Please feel free to open a PR with a possible solution!
I have already done an implementation, just only not fully sure if it's needed at all, once I get sure I'll do a PR. By the moment, I have at https://github.com/jazzband/django-polymorphic/commit/f075aabd4ff705eebeb16676fdd13295cffee8a7 a fix to properly notify with a server side 500 error when there are no configured child models, instead of a non-sense 403 error.
Sounds good!
You have the PR at https://github.com/jazzband/django-polymorphic/pull/582, you can review and comment it. I think it works properly, although would like to test it a bit more, specially I would ensure inlines are working properly because I'm having problems with them, I think it's about config on my side instead of a bug but want to ensure it.
The same as
PolymorphicParentModelAdmin.get_child_models()
allows to dynamically get the child models withbase_model.__subclasses__()
, I would like to havePolymorphicInlineModelAdmin.get_child_inlines()
method that I can overwrite to get the inlines subclasses, and don't need to set them explicitly. This would allows me to have a cleaner code, and also prevent some circular references.