Skip to content

Issue with the base_objects deprecation and proxy model QuerySets #466

@pfcodes

Description

@pfcodes

When using a proxy model. Using ProxyModel.base_objects.all() will correctly return a QuerySet of base model instances downcasted as proxy model instances.

But using base_objects prints out this deprecation warning:

:1: DeprecationWarning: Using PolymorphicModel.base_objects is deprecated.
Use PolymorphicModelBase.objects.non_polymorphic() instead.

The problem with using a PolymorphicModelBase.objects.non_polymorphic() QuerySet is that it won't downcast its instances to be proxy model instances.

I have proxy models that contain different properties and methods but refer to the same base model. Without .base_objects there is no way to get this type of QuerySet downcasted with proxy model instances.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions