Re: [sqlalchemy] Sequence on non primary_key and import data

2012-01-16 Thread Martijn Moeling
Bump. On Jan 10, 2012, at 12:06 , Martijn Moeling wrote: Hi, I am running into something I am using MySQL but am moving to Postgress so I'm looking for something compatible with the two. I have to generate an unique number for each record created into a column separate from the

Re: [sqlalchemy] Sequence on non primary_key and import data

2012-01-16 Thread Michael Bayer
On Jan 16, 2012, at 6:29 AM, Martijn Moeling wrote: Now I need to import data from the current production system. This data already has Serialnumbers generated. What should I do to make this work? Do I need the sequence created after the Import and set the Start value to the last

[sqlalchemy] column_property and Firebird

2012-01-16 Thread werner
I would like to do this type of thing: namesandvar = column_property(names + + variety) and use it e.g. like: query(db.Cellarbook).filter(db.Drinkinfo.namesandvar.contains(u'menu')) But Firebird SQL doesn't like the + operator, it throws an error Strings cannot be added or subtracted in

Re: [sqlalchemy] column_property and Firebird

2012-01-16 Thread Michael Bayer
On Jan 16, 2012, at 11:46 AM, werner wrote: I would like to do this type of thing: namesandvar = column_property(names + + variety) and use it e.g. like: query(db.Cellarbook).filter(db.Drinkinfo.namesandvar.contains(u'menu')) But Firebird SQL doesn't like the + operator, it

Re: [sqlalchemy] Modifying a relationship before it gets inserted

2012-01-16 Thread Mariano Mara
On 05.01.12 16:13, Michael Bayer wrote: On Jan 5, 2012, at 3:03 PM, Mariano Mara wrote: Hi there! I have a master-detail entity. Since I do some post-processing work on the details before inserting the entity in the db, I added an 'after_insert' event where I do the extra stuff.

Re: [sqlalchemy] column_property and Firebird

2012-01-16 Thread werner
Michael, On 01/16/2012 05:53 PM, Michael Bayer wrote: On Jan 16, 2012, at 11:46 AM, werner wrote: I would like to do this type of thing: namesandvar = column_property(names + + variety) and use it e.g. like: query(db.Cellarbook).filter(db.Drinkinfo.namesandvar.contains(u'menu')) But

Re: [sqlalchemy] Modifying a relationship before it gets inserted

2012-01-16 Thread Michael Bayer
On Jan 16, 2012, at 12:53 PM, Mariano Mara wrote: On 05.01.12 16:13, Michael Bayer wrote: On Jan 5, 2012, at 3:03 PM, Mariano Mara wrote: Hi there! I have a master-detail entity. Since I do some post-processing work on the details before inserting the entity in the db, I added an

Re: [sqlalchemy] Sequence on non primary_key and import data

2012-01-16 Thread Martijn Moeling
I am planning on using PG for production but for now I'm stuck on Mysql. Mysql does not seem to support Sequence.. can't I just do x = Column(Integer, autoincreament=True) Would that work on both? I cannot test PG just jet. On Jan 16, 2012, at 5:07 PM, Michael B ayer wrote: On Jan 16,

[sqlalchemy] SQLAlchemy training

2012-01-16 Thread erikj
Hello, Together with the Python Academy, we are organizing a SQLAlchemy training on 9th of February in Leipzig, Germany. If you are interested, you can find more information at : http://www.conceptive.be/training.html In the same week we organize a general Python and a Camelot training as

Re: [sqlalchemy] Sequence on non primary_key and import data

2012-01-16 Thread Michael Bayer
On Jan 16, 2012, at 5:14 PM, Martijn Moeling wrote: I am planning on using PG for production but for now I'm stuck on Mysql. Mysql does not seem to support Sequence.. can't I just do x = Column(Integer, autoincreament=True) Would that work on both? I cannot test PG just jet. MySQL's

[sqlalchemy] datetime to utc

2012-01-16 Thread Mason
Hi I have the following statement rows = self.session.query(e.src_id, e.tar_id, \ e.type, m.text, e.event_ts).\ outerjoin(m, e.media_id==m.message_id).\ filter(e.src_id==src_id).\

[sqlalchemy] Elixir: Enum and accented characters (non-ASCII character)

2012-01-16 Thread Pierre Bossé
Hello, Here is my problem: I would define a domain of values ​​for a table field. Some values ​​ have accented characters (non-ASCII character). When generating the DDL for Elixir, a conversion is made on the values ​​provided by the accented characters and no longer. Here is my test code:

Re: [sqlalchemy] Elixir: Enum and accented characters (non-ASCII character)

2012-01-16 Thread Michael Bayer
On Jan 16, 2012, at 7:35 AM, Pierre Bossé wrote: Hello, Here is my problem: I would define a domain of values ​​for a table field. Some values ​​ have accented characters (non-ASCII character). When generating the DDL for Elixir, a conversion is made on the values ​​provided by the

Re: [sqlalchemy] datetime to utc

2012-01-16 Thread Michael Bayer
On Jan 16, 2012, at 8:34 PM, Mason wrote: Hi I have the following statement rows = self.session.query(e.src_id, e.tar_id, \ e.type, m.text, e.event_ts).\ outerjoin(m, e.media_id==m.message_id).\