[sqlalchemy] How to update large data?

2013-06-30 Thread MacVictor
Hi, I try update large data: create_price = [] for x in range(0, 10900): price = Price(int(array_name[x]), extra=0) create_price.append(price) session.add_all(create_price) # for y in range(1, 10901): session.query(Person).filter_by(id=y).update({price_id: create_price[y]},

[sqlalchemy] How to update large data?

2013-06-30 Thread MacVictor
array_name contains 10900 price. create_price = [] for x in range(0, 10900): price = Price(int(array_name[x]), extra=0) create_price.append(price) session.add_all(create_price) for y in range(1, 10901): session.query(Person).filter_by(id=y).update({price_id:

[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

[sqlalchemy] is it possible to adapt an object without configuring SqlAlchemy ?

2013-06-30 Thread Jonathan Vanasco
I have a custom object that I use within my application: class Foo(bar): def __init__( self , value=None ): self.value = value def __int__ def __str__ def __cmp__ is there any __baz__ method I can use, that will return a value SqlAlchemy can

[sqlalchemy] Re: is it possible to adapt an object without configuring SqlAlchemy ?

2013-06-30 Thread Jonathan Vanasco
actually, nevermind i just remembered Mike talking about __repr__ last week in his presentation and I tried that. it works. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails from it, send an

Re: [sqlalchemy] Updating using a join - Wrong parameter substitution order

2013-06-30 Thread RedBaron
The fix mentioned in the ticket works for me. Thanks, Dheeraj On Friday, 28 June 2013 20:45:50 UTC+5:30, Michael Bayer wrote: On Jun 28, 2013, at 10:26 AM, RedBaron dheeraj...@gmail.com javascript: wrote: Thanks for the reply. I understand that update against multiple tables is