polymorphic.utils

polymorphic.utils.get_base_polymorphic_model(ChildModel, allow_abstract=False)

First the first concrete model in the inheritance chain that inherited from the PolymorphicModel.

polymorphic.utils.reset_polymorphic_ctype(*models, **filters)

Set the polymorphic content-type ID field to the proper model Sort the *models from base class to descending class, to make sure the content types are properly assigned.

Add ignore_existing=True to skip models which already have a polymorphic content type.

polymorphic.utils.sort_by_subclass(*classes)

Sort a series of models by their inheritance order.