sqlalchemy-utils

Python SQLAlchemy PostgreSQL find by primary key Deprecate message

Python SQLAlchemy PostgreSQL find by primary key Deprecate message Question: I use below code to find the object by primary key. Now I am getting this Deprecated features detected message. How can I re-write this query to fix the deprecated message. Code: def find_by_id(self, obj_id): with self.session() as s: x = s.query(User).get(obj_id) return x Warning: …

Total answers: 1

Python SQLAlchemy PostgreSQL Deprecated API features

Python SQLAlchemy PostgreSQL Deprecated API features Question: I am using following code to create the function and trigger to update the created_at and updated_at fields. with upgrade of new module getting the deprecated API warning. How can I replace engine.execute(sa.text(create_refresh_updated_at_func.format(schema=my_schema))) line to remove the warning message? Code: mapper_registry.metadata.create_all(engine, checkfirst=True) create_refresh_updated_at_func = """ CREATE OR REPLACE …

Total answers: 1