Youngestdev / fastapi-beanie

MIT License
9 stars 4 forks source link

Replace deprecated .dict().items with model_dump #5

Open clabnet opened 7 months ago

clabnet commented 7 months ago

Hi, I would replace deprecated dict().items() with the modern model_dump

    req = {k: v for k, v in script.dict().items() if v is not None}
    update_query = {"$set": {field: value for field, value in req.items()}}

How to update the code for this ?

Thank you for this code. I learning many things from it.