[sqlalchemy] Re: update existing row

2011-07-30 Thread vitsin
Maybe someone can just place an example of correct update() usage please: can't sort it out from docs rather google, thanks. On Jul 30, 3:51 pm, vitsin wrote: > hi, > can't figure out why raw SQL works fine, but update() is not working: > 1.working raw SQL: > self.session.execute("update public.m

[sqlalchemy] Re: Cascade Deletes

2011-07-30 Thread Aviv Giladi
Sorry, but I am really confused. Are you guys saying that on SQLite for example, cascade deletes don't work at all? Or do they work, but are less efficient? Thanks again! On Jul 30, 11:08 am, Michael Bayer wrote: > SQLAlchemy's "cascade='all, delete-orphan'" implements the same CASCADE > functi

[sqlalchemy] update existing row

2011-07-30 Thread vitsin
hi, can't figure out why raw SQL works fine, but update() is not working: 1.working raw SQL: self.session.execute("update public.my_table set status='L',updated_at=now() where my_name='%s'" % (self.my_name)) 2.non working update() from Alchemy: s = aliased(MyTable) query = self.session.query(s).fi

Re: [sqlalchemy] Re: Cascade Deletes

2011-07-30 Thread Michael Bayer
SQLAlchemy's "cascade='all, delete-orphan'" implements the same CASCADE functionality as ONDELETE does, in Python. It is just less efficient since collections need to be fully loaded into memory for them to be processed. On Jul 30, 2011, at 1:49 PM, Aviv Giladi wrote: > Thank you for your res

[sqlalchemy] Re: Cascade Deletes

2011-07-30 Thread Aviv Giladi
Thank you for your response. In that case, how do you manage these kinds of situations in SQLite and other engines in MySQL? Do you manually delete the children as well? On Jul 28, 10:35 am, Stefano Fontanelli wrote: > Il 28/07/11 01.15, Aviv Giladi ha scritto: > > > Hi, > > > I am actually usin