I have model FruitCategories which uses the bidirectional adjacency list
pattern ("Node") from the documentation. It is used to create a
many-to-many connection to a model, say, Fruit, with an association table
("fruits_cats"), again vanilla like the docs. This all works great.
I have other completely unrelated categories for unrelated entities in
similar many-to-many , and I though I could convert this into a generic
setup. The categories table would become a general single-table
polymorphic inheritance setup, where FruitCategories might have polymorphic
type 1, HighwayCategories (which would map with a Highway entitiy) as 2,
etc. It would seem the different category systems could share the same
table.
What I was wondering was if there would be a way to share the association
table in this setup, instead of having to create one for each new
category-entity combo? Presumably a polymorphic association table isn't a
thing; could a polymorphic association object be set up, and each mapping
combo would create a subclass of Category and the association object. I
have a hazy sense that declared_attr would have to be involved for one side
of the association and the Category children definition, but my head starts
spinning when I get this far.
Or am I going down a rabbit hole and should just create a new association
table for each mapping combo?
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.