Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

type object 'Base' has no attribute '_decl_class_registry'

I am upgrading a library to a recent version of SQLAlchemy and I am getting this error

type object 'Base' has no attribute '_decl_class_registry'

On line

Base = declarative_base(metadata=metadata)

Base._decl_class_registry

How can I solve this?

like image 593
Rodrigo Avatar asked May 17 '26 12:05

Rodrigo


1 Answers

Had the same problem. Because of my upgrade of sqlalchemy looks like there is a change in the base code.

use this instead to accomplish the same

Base.registry._class_registry.values()
like image 79
Ajay Reddy Avatar answered May 20 '26 00:05

Ajay Reddy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!