Re: [sqlalchemy] update with custom Type

2013-08-29 Thread Sebastian Elsner
After much thought and playing around I think I may have over-complicated the problem and found an easier way to do what I wanted: s.query(Foo).update({timcode_column: func.concat(func.left(Foo.timcode_column, 11), :, 24) },False) Thanks for the help anyway :) On 08/28/2013 08:08 PM,

[sqlalchemy] update with custom Type

2013-08-28 Thread Sebastian Elsner
Hello, I have an augmented type that holds data for a movie's timecode, which has the format 00:00:00:00 (hours:minutes:seconds:frame) and is serialized as a CHAR: class Timecode(TypeDecorator): impl = CHAR def load_dialect_impl(self, dialect): return

Re: [sqlalchemy] update with custom Type

2013-08-28 Thread Michael Bayer
On Aug 28, 2013, at 9:59 AM, Sebastian Elsner sebast...@risefx.com wrote: Now I would like to be able to do the following: s.query(Foo).update({some_timecode: Foo.some_timecode.add_hours(5)}) # Adds 5 hours to every Foo's timecode I have seen this should be possible with a Comparator