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 factory in 0.8 but I am 
> stuck with 0.7 for now. How can I do this with 0.7?

just move out your function:


update({"sometimecode": add_hours(Foo.some_timecode, 5)})

> Something like this would also be OK for me:
> 
> s.query(Foo).update({"some_timecode": Foo.some_timecode + 
> TC("01:00:00:00:00")})
> 
> I have tried implementing the __add__ for both the TC and Timecode class and 
> read the "Augmenting Existing Types" help, but failed to put the puzzle 
> together.
> 
> Thank you for helping!
> 
> Sebastian
> 
> -- 
> check out www.pointcloud9.com
> 
> Sebastian Elsner - Pipeline Technical Director - RISE
> 
> t: +49 30 20180300 flor...@risefx.com
> f: +49 30 61651074 www.risefx.com
> 
> RISE FX GmbH
> Schlesische Strasse 28, Aufgang B, 10997 Berlin
> c/o action concept, An der Hasenkaule 1-7, 50354 Hürth
> Geschaeftsfuehrer: Sven Pannicke, Robert Pinnow
> Handelsregister Berlin HRB 106667 B
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/groups/opt_out.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to