Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PolymorphicInlineModelAdmin.get_child_inlines() #576

Open
piranna opened this issue Feb 12, 2024 · 4 comments · May be fixed by #582
Open

Add PolymorphicInlineModelAdmin.get_child_inlines() #576

piranna opened this issue Feb 12, 2024 · 4 comments · May be fixed by #582

Comments

@piranna
Copy link

piranna commented Feb 12, 2024

The same as PolymorphicParentModelAdmin.get_child_models() allows to dynamically get the child models with base_model.__subclasses__(), I would like to have PolymorphicInlineModelAdmin.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.

@j-antunes
Copy link
Contributor

Hi! Thanks for opening an issue! Please feel free to open a PR with a possible solution!

@piranna
Copy link
Author

piranna commented Feb 21, 2024

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 f075aab 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.

@j-antunes
Copy link
Contributor

Sounds good!

@piranna piranna linked a pull request Feb 29, 2024 that will close this issue
@piranna
Copy link
Author

piranna commented Feb 29, 2024

You have the PR at #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants