server.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:planty 作者: agnaite 项目源码 文件源码
def get_user_info(user_id):
    """Retrieves user data based on the user ID."""

    user = User.query.get(user_id)
    user = user.__dict__

    if '_sa_instance_state' in user:
        del user['_sa_instance_state']

    user_plants = get_user_plants(user_id)

    user['plants'] = user_plants

    # adds a key to dictionary that has a value of true/false depending on
    # whether reminder was set
    for plant in user['plants']:
        user['plants'][plant]['reminder_status'] = str(get_reminder_status(user['user_id'], user['plants'][plant]['plant_id']))

    return jsonify(user)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号