Skip to content

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

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy