Use declarative mixin for feedback option tree structure
The following discussion from !375 (merged) should be addressed:
-
@Hugo started a discussion: (+2 comments) Since a lot of functions currently existing for
FeedbackOption
are general for tree structures, we might create aTreeMixin
that implementsparents
,childrens
,all_descendants
,all_ancestors
,siblings
. Even theparent_id
andid
columns could be part of this mixin.EDIT: And of course SQLAlchemy has thought of this: https://docs.sqlalchemy.org/en/14/orm/declarative_mixins.html. Seriously though, almost every little thing you want to do with SQLAlchemy is possible natively.