Re: [sqlalchemy] Very strange behaviour in SqlAlchemy (maybe a bug)

2010-10-15 Thread Christian Démolis
Thanks 2010/10/14 Michael Bayer mike...@zzzcomputing.com On Oct 13, 2010, at 10:48 AM, Christian Démolis wrote: Hi, q = model.session.query( # model.Collaborateur.LesIns.any(model.or_(model.Instruction.FinValiditetime.time(), model.Instruction.FinValidite==None)),

[sqlalchemy] self_group on Query

2010-10-15 Thread Sebastian Elsner
Hello, wanting to create the following query: (SELECT * from tbl ORDER BY b LIMIT 5) UNION ALL (SELECT * from tbl ORDER BY a LIMIT 5) The important thing are the (), which I cant get to work with the examples in the union() docs . I came across a solution involving self_group on Queries

Re: [sqlalchemy] Polyphormic class insertion by SA .vs. by database triggers

2010-10-15 Thread Cleber Rodrigues
What would it do , INSERT into the parent table, then the child row is created implicitly and then.do an UPDATE to the child table ? where does the stored procedure get the values to be set up for the child row ? The trigger is activated on INSERTS only, and creates the child row using

[sqlalchemy] before_insert for MapperExtension

2010-10-15 Thread Kent
Suppose I have a collection of new objects in a one to many relationship list. (A plain python list is instrumented for the collection) Am I guaranteed that the objects' MapperExtension's before_insert() method will be invoked in the same order as the items in the collection? Thanks, Kent --

Re: [sqlalchemy] before_insert for MapperExtension

2010-10-15 Thread Michael Bayer
On Oct 15, 2010, at 9:36 AM, Kent wrote: Suppose I have a collection of new objects in a one to many relationship list. (A plain python list is instrumented for the collection) Am I guaranteed that the objects' MapperExtension's before_insert() method will be invoked in the same order as

Re: [sqlalchemy] self_group on Query

2010-10-15 Thread Michael Bayer
On Oct 15, 2010, at 7:43 AM, Sebastian Elsner wrote: Hello, wanting to create the following query: (SELECT * from tbl ORDER BY b LIMIT 5) UNION ALL (SELECT * from tbl ORDER BY a LIMIT 5) First note that ORDER BY is not valid at the level you are placing it (many databases won't accept

[sqlalchemy] When is 'default' applied?

2010-10-15 Thread Michael Hipp
If I have a column defined like this: qty = Column(Numeric, nullable=False, default=Decimal('1')) When is the default applied? At commit()? Michael -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to

[sqlalchemy] String formatting issues with connection.execute(sql_str)

2010-10-15 Thread William Furnass
Trying to follow the SQLA tutorial at http://mapfish.org/doc/tutorials/sqlalchemy.html but find that I get stuck at the first hurdle (the Engine API bit) due to a string formatting problem: sqlalchemy.exc.ProgrammingError: (ProgrammingError) syntax error at or near , LINE 1: INSERT INTO

[sqlalchemy] server_default argument in Column(DateTime, server_default = ...)

2010-10-15 Thread Domingo Aguilera
HI, I wonder if there's a way to use server_default in Column ( DateTime, server_default = ...) to make a database agnostic current timestamp as default . Cheers. -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email

Re: [sqlalchemy] When is 'default' applied?

2010-10-15 Thread Michael Hipp
On 10/15/2010 5:30 PM, Michael Hipp wrote: If I have a column defined like this: qty = Column(Numeric, nullable=False, default=Decimal('1')) When is the default applied? At commit()? Nevermind. Finally found it in the docs, appears it happens at INSERT time. Thanks, Michael -- You received