Skip to content
Advertisement

In my List of multiple dictionaries only my last dictionary item save on database, I want to save all [closed]

I would like to save each dictionary as a separate instance of a db model using sqlalchemy.

I tried

JavaScript

in output

JavaScript

It only saves the last item , I want to save all the item in database. I’m using Postgresql

Advertisement

Answer

I’m pretty sure that only the last item is saved because you only save the last item.

You probably wrote something like this:

JavaScript

when in fact you should have written this:

JavaScript
Advertisement