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

Handle subclasses of PolymorphicModel being abstract #228

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

trumpet2012
Copy link

When there was an abstract model in between a concrete subclass and it's PolymorphicModel class, the admin would not allow the child model to be moved because it was not in the allowed "childModels" being passed to the frontend.

For example the following would break:

graph TD;
  A[PolymorphicModel];
  A --> B[AbstractBase];
  B --> C[ChildOfAbstract];
  B --> D[ChildOfAbstract2];
  A --> E[DirectPolymorphicChild];

Before, the only valid child models passed to the frontend would be DirectPolymorphicChild and AbstractBase. This meant that ChildOfAbstract and ChildOfAbstract2 could be added to the admin, but were blocked from being moved around.

Added a test app to verify this change and show that now having an abstract class doesn't break the admin.

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 this pull request may close these issues.

None yet

1 participant