flask-resty icon indicating copy to clipboard operation
flask-resty copied to clipboard

Update POST request data

Open paulkatich opened this issue 2 years ago • 2 comments

I would like to update the POST data, part of the data should be updated by the server. I see we do that for soft delete where we can override delete_item_raw and delete_item and it works. Similarly I want to update the POST request data before saving to the database. I am overriding the "create_item_raw" method but getting an error. How can I update post and not run in to the builtins.dict error.

venv/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 207, in raise_ raise exception sqlalchemy.orm.exc.UnmappedInstanceError: Class 'builtins.dict' is not mapped

paulkatich avatar Sep 29 '21 13:09 paulkatich

You're interested in update_item possibly? https://flask-resty.readthedocs.io/en/latest/api.html?highlight=update_item#flask_resty.ModelView.update_item (also maybe update_item_raw)

c0state avatar Sep 29 '21 14:09 c0state

can you give me more information? can you give us the code that's raising the error and the full stack trace?

itajaja avatar Sep 29 '21 16:09 itajaja