Skip to content

ModelSerializer fails to generate fields for Models that inherit from an abstract base class Model #3117

Closed
@erikcw

Description

@erikcw

I did some searching in the closed issues, and it looks like the decision was to raise an exception when attempting to use ModelSerializer with an abstract base class model. (#2757)

I have a model that inherits from an abstract base class model. No exception was thrown by DRF. Additionally, the Serializer doesn't generate the fields for the sub-class, instead it only renders the fields from the abstract base class.

If this isn't going to be supported, the assertion should probably check if the superclass is abstract and then fail loudly.

I'm on DRF 3.1.3.

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