Why doesn't FlaskSQLAlchemyBase inherit from model_class arg #1377
              
                Unanswered
              
          
                  
                    
                      quentinboudinel
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a reason why FlaskSQLAlchemyBase (dynamically created in SQLALchemy._make_declarative_base) has to be sort of a copy of the class passed to model_class (using its dict and bases) instead of just inherit from it ?
I'm asking the question because I encountered an issue where I could not define init_subclass on the class (Base) I passed to model_class. When calling super() inside of Base, it would raise an error as my models are not subclasses of Base.
>>> TypeError: super(type, obj): obj must be an instance or subtype of typeBeta Was this translation helpful? Give feedback.
All reactions