Python 数据库操作:使用 query.filter() 查询数据
No, the code you provided is a query that retrieves data from the database. It does not directly modify the contents of the database. The query filters the data based on certain conditions and returns the matching results.\n\nIf you want to modify the contents of the database, you need to use other methods such as update() or delete() in combination with appropriate filters to update or delete the desired records.\n\nRegarding your second question, str(HandleGuancexinxi.user_id) == g.user.user_id is a comparison between the string representation of HandleGuancexinxi.user_id and g.user.user_id. This condition checks if the two values are equal. However, it does not perform any database operations.
原文地址: https://www.cveoy.top/t/topic/p3DL 著作权归作者所有。请勿转载和采集!