Re: [sqlalchemy] Re: How to update large data?

2013-07-08 Thread Pau Tallada
Try adding a relationship between Person and Price. Then, you could do something like: for x in range(1, 10901): person = session.query(Person).get(x) price = Price(int(array_name[x-1]), extra=0) session.add(price) person.price = price ses

[sqlalchemy] Re: How to update large data?

2013-06-30 Thread MacVictor
I try to use this method, but it's also not a good idea: for x in range(1, 10901): person = session.query(Person).get(x) price = Price(int(array_name[x-1]), extra=0) session.add(price) session.flush() person.price_id = price.id session.add(person