AliasedClass or aliased(model) can't be inherited correctly

Issue #3515 closed
Adriel Velazquez created an issue

AliasedClass or an aliased(model) isn't an inhertiable class.

Currently if you want to create a separate class that mimics the same model with complex polymorphic relationships. Creating an Aliased class is the only way of doing so so that the mappers are pointing to the same location; however, Aliased models can't accept custom session.query_properties or inherited to expand on these functionalities.

Comments (3)

  1. Mike Bayer repo owner

    Currently if you want to create a separate class that mimics the same model with complex polymorphic relationships. Creating an Aliased class is the only way of doing so so that the mappers are pointing to the same location;

    this is incorrect. you can make a subclass of the original mapped class. Subclassing an AliasedClass object is not necessary nor is it appropriate.

    Please illustrate an exact use case and I'll show you how to do it.

  2. Log in to comment