Skip to content

AutoTableNameMeta enhancement: automatically detect when single table inheritance is used #164

@ods

Description

@ods

Right now user has to specify __tablename__ = None to disable setting new name. SQLAlchemy extension to Flask does simple check to see if class dictionary has columns with primary_key set to True. This checks doesn't cover all possible cases, but works for the most used one.

Cases where Flask fails:

  • Columns properties
  • Composite properties
  • Declared attributes
  • Primary key defined in __table_args__

Some of them are important to us since we use factories that wrap all collumns.

It's not obvious how to handle classes that inherit primary key from abstract class (__abstract__ = True).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions