harbor run -t openthoughts/tasktrove-exp-flat25-stackoverflow-v2-5k-stackoverflow-4298harbor download openthoughts/tasktrove-exp-flat25-stackoverflow-v2-5k-stackoverflow-4298Title: SQLAlchemy declarative base: automatic and nuanced tablename inference with inheritance and mixins (single/joined inheritance, abstract bases, and declared_attr propagation)
Body: I’m working with a SQLAlchemy-based project that exposes a db.Model declarative base (via a test fixture) and I need to extend its behavior so that tablename is determined automatically and consistently across many inheritance/mixin scenarios, while still honoring explicit overrides. The goal is to satisfy a comprehensive pytest suite that encodes nuanced rules about naming and mapping. I’m looking for guidance and/or a robust implementation that can be integrated into the existing codebase (self-contained, relying only on SQLAlchemy, no external dependencies).
What I need to implement
Specific requirements that will make the tests pass
Deliverable
Notes
Example (illustrative, not the actual patch)
If you have guidance, a design outline, or concrete code changes (ideally patches or a PR outline) that implement these behaviors in a way that integrates with the existing db.Model and test suite, I’d appreciate it.