There is a need to get the name of the SQLAlchemy objects. You can do it like this: db.metadata.tables.keys() , and the result is what you need - the names of the tables.

However, the task is a little more difficult: I want to have a key at the entrance, go through the list or the dictionary, and get the table whose name somehow coincides with the key.

 @bp.route('/post', methods=['PUT']) @UserPermission() def post(): tables = list(db.metadata.tables.keys()) url = request.form['keyword'] return render_template(index/index.html, items=items) 

I want to pass the result to the items by keyword. The above method returns an AttributeError:

    1 answer 1

    In my case, it worked like this:

     @bp.route('/post', methods=['GET', 'POST', 'PUT']) @UserPermission() def post(): request_url = request.form['url'] baselist = [User, Organisation, Contact, Project, Activity, Invoice] for i in baselist: if str(i.__tablename__) == str(request_url.split('/')[-1][:-1]): 

    It would be cool not to keep such a list, but to receive a selection of imports.