Re: [sqlalchemy] How-to : update A also create an update of B

2012-08-31 Thread Tony Moutaux
Le jeudi 30 août 2012 17:16:40 UTC+2, Michael Bayer a écrit : def after_flush(session, flush_context): my_bs = figure_out_bs(session) new_session = Session(bind=session.connection()) new_session.add_all(my_bs) # this won't actually

[sqlalchemy] How-to : update A also create an update of B

2012-08-30 Thread Tony Moutaux
Hi there ! I'm going mad looking for a solution for what seems a simple problem. When object A is updated, I also want object B to be updated, using some computation based on A new values. From now, I can detect when A is modified using after_update. What I try is to look at event

[sqlalchemy] Re: How-to : update A also create an update of B

2012-08-30 Thread Tony Moutaux
A friend point me out the hybrid_property and the fact I can detect an update of A fields before doing the commit, issuing some update for B. I'll try this idea. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To view this discussion on the web

Re: [sqlalchemy] How-to : update A also create an update of B

2012-08-30 Thread Tony Moutaux
Only if some computation based on A new values means that there are SQL-level functions which you need to get at, does the rationale for after_update/after_flush events to come up.Unfortunately you can't emit a flush() within any of these events, as they are already local to the

[sqlalchemy] Re: Table name without quoting with upper case

2010-11-26 Thread Tony Moutaux
On 25 nov, 16:28, Michael Bayer mike...@zzzcomputing.com wrote: I did a little googling and Sybase can handle the quotes, if you set set quoted_identifier on on your database.   (http://manuals.sybase.com/onlinebooks/group-as/asg1250e/sqlug/@ebt-li...) Yep ! That's kind of solution, also

[sqlalchemy] Table name without quoting with upper case

2010-11-25 Thread Tony Moutaux
Hi there ! I'm a newby du SA and try to make it work with our production platform, using Sybase and old and scarry database schema, with table names like Prestation , with 1 upper case. Sybase does not allow (to my knowledge) tu use something like select Prestation.id So I try to figure how to