Re: [sqlalchemy] Re: AuditLog/History logging

2010-11-04 Thread chaouche yacine
whether the instance going to be deleted or updated or insert. How do I get the property? And during update, how to identify which field has been modified? Regards, Krish On Nov 3, 6:30 pm, chaouche yacine yacinechaou...@yahoo.com wrote: http://www.sqlalchemy.org/docs/orm/examples.html?highlight

Re: [sqlalchemy] AuditLog/History logging

2010-11-03 Thread chaouche yacine
I know that elixir has an extension that does just this. You don't have to subclass, you just use a acts_as_versioned statement in your class definition and that's it. In addition, it will let you get the object at any of its verison (you can revert back changes, a sort of undo

Re: [sqlalchemy] AuditLog/History logging

2010-11-03 Thread chaouche yacine
http://www.sqlalchemy.org/docs/orm/examples.html?highlight=versioning#versioning You can find other interesting recipes in : http://www.sqlalchemy.org/trac/wiki/UsageRecipes Cheers, Y.Chaouche - Original Message From: Gopalakrishnan Subramani gopalakrishnan.subram...@gmail.com To:

Re: [sqlalchemy] Checking the availablity of a booked Item

2010-10-20 Thread chaouche yacine
of join I want to perform, and modify the syntax above to make it match the SQL. -- Thadeus On Mon, Oct 18, 2010 at 10:38 AM, chaouche yacine yacinechaou...@yahoo.com wrote: Hello, I think outerjoin is just a join with an isouter = True, and above all the problem was not there anyway

Re: [sqlalchemy] Checking the availablity of a booked Item

2010-10-18 Thread chaouche yacine
/reference/orm/query.html#sqlalchemy.orm.join isouter = True -- Thadeus On Thu, Oct 14, 2010 at 10:26 AM, chaouche yacine yacinechaou...@yahoo.com wrote: Here's the SQL I got : SELECT face.id AS face_id FROM face LEFT OUTER JOIN face_bookings__booking_faces

Re: [sqlalchemy] Checking the availablity of a booked Item

2010-10-14 Thread chaouche yacine
= query.join(Booking.time_period)     return query.all() And still not the expected results (it should return faces with no bookings at all but it doesen't). Thanks for any help. Y.Chaouche --- On Wed, 10/13/10, chaouche yacine yacinechaou...@yahoo.com wrote: From: chaouche yacine yacinechaou

Re: [sqlalchemy] Checking the availablity of a booked Item

2010-10-14 Thread chaouche yacine
= query.join(Booking.time_period)     return query.all() And still not the expected results (it should return faces with no bookings at all but it doesen't). Thanks for any help. Y.Chaouche --- On Wed, 10/13/10, chaouche yacine yacinechaou...@yahoo.com wrote: From: chaouche yacine yacinechaou

Re: [sqlalchemy] Checking the availablity of a booked Item

2010-10-13 Thread chaouche yacine
should return the expected results. -- Thadeus On Tue, Oct 12, 2010 at 1:41 PM, chaouche yacine yacinechaou...@yahoo.com wrote: Hello, Here's my simple model (For simplification, consider Face as a Billboard) : +-+          +---+       +--+ |Face |..   |Campaign

[sqlalchemy] Checking the availablity of a booked Item

2010-10-12 Thread chaouche yacine
Hello, Here's my simple model (For simplification, consider Face as a Billboard) : +-+ +---+ +--+ |Face |.. |Campaign | ...|TimePeriod| +-+ . +---+ . +--+ |code | . |time_period| |start_time| +-+ .

Re: [sqlalchemy] Copying instances from old to new schema DB

2010-09-12 Thread chaouche yacine
, 9/9/10, Michael Bayer mike...@zzzcomputing.com wrote: From: Michael Bayer mike...@zzzcomputing.com Subject: Re: [sqlalchemy] Copying instances from old to new schema DB To: sqlalchemy@googlegroups.com Date: Thursday, September 9, 2010, 9:54 AM On Sep 9, 2010, at 11:31 AM, chaouche yacine

Re: [sqlalchemy] Copying instances from old to new schema DB

2010-09-09 Thread chaouche yacine
To: sqlalchemy@googlegroups.com Date: Thursday, September 9, 2010, 5:59 AM On Sep 9, 2010, at 6:31 AM, chaouche yacine wrote: Hello list, My schema has changed, and now I want to retrieve my old data (of the old schema) to the new database (with the new schema) from csv files (I export

[sqlalchemy] update a relation from its id

2010-09-02 Thread chaouche yacine
Hello group, Suppose A has a ManyToOne relation to B (A is a child of B). I want to perform something like : a.b_id = b.id assert a.b == b How do I do this in sqlalchemy ? The following attempt failed --- from sqlalchemy import * from sqlalchemy.orm import

Re: [sqlalchemy] how to change a database

2009-12-03 Thread chaouche yacine
Why not create a different engine for that database ? --- On Thu, 12/3/09, Peter vm...@mycircuit.org wrote: From: Peter vm...@mycircuit.org Subject: [sqlalchemy] how to change a database To: sqlalchemy@googlegroups.com Date: Thursday, December 3, 2009, 4:37 AM Hi Lets suppose I created

Re: [sqlalchemy] get_or_create(**kwargs) ?

2009-11-23 Thread chaouche yacine
--- On Sun, 11/22/09, Conor conor.edward.da...@gmail.com wrote: There is a problem with your code when the tag is in the cache: if the tag is added to the session via session.add or a relation add cascade, SQLAlchemy will try to INSERT the tag into the database on the next flush.

Re: [sqlalchemy] get_or_create(**kwargs) ?

2009-11-22 Thread chaouche yacine
--- On Fri, 11/20/09, Conor conor.edward.da...@gmail.com wrote: Also, there is a recipe that looks for a matching object in the session before querying the database: http://www.sqlalchemy.org/trac/wiki/UsageRecipes/UniqueObject -Conor Thank you Conor for you useful pointer. I have

[sqlalchemy] get_or_create(**kwargs) ?

2009-11-20 Thread chaouche yacine
Hello, This is the first time I try an ORM, and I chose SQLAlchemy, which is popular amongst pythonistas. Since I am a complete beginner, here's my beginner's two cents question : Suppose you have a very basic model like this (pseudo code) : User(firstname,lastname,nick,ManyToOne(city))