Figured it out. It wasn't FlaskSqlalchemy, it was me.
The decalrative base class inherited from References which had the
__declarefirst__ in it. Trying to instantiate a declarative class (which
inherited from References) inside __declarefirst__ fired that event, which
caused the error. I removed
the issue would be this:
base_class = get_declarative_base(cls)
association_class = type(association_class_name, (base_class,),
association_class_attributes)
that is, you're making a new declarative class inside the
__declare_first__() hook. That class itself also has __dec
I trimmed the business-logic part. Here's a really full stacktrace for the
sandbox.py file I attached:
Traceback (most recent call last):
File "C:/Users/vToMy/PycharmProjects/sandbox/sandbox.py", line 197, in
user = User()
File "", line 2, in __init__
File
"C:\Users\vToMy\PycharmProj