I have used this pattern in the past with flask but I think there are a number of issues with your implementation; I think itsit's better to know the model directly from the class, as this enable you only import the model class once:
class BaseManager: model_type = None def __init__(self, model=None, **kwargs): # The base class keeps a reference of the orm model if model is None: # other init code from the create() class func can go here model = self.model_type(**kwargs) self.model = model Next, the other class methods can be removed. In place of a get_food() class method, you can put a get_by_id in the base class:
@classmethod def get_by_id(cls, id): # Get a model by its id # Similar to `__init__` method, but the ORM model comes from # the db model = cls.model_type.query.filter_by(id=id).first() return cls(model)