[sqlalchemy] How can I change manually the value of field with onupdate option ? I would like override onupdate mechanism

2010-10-28 Thread KLEIN Stéphane
Hi, in my project, I use onupdate attribute : foobar_table = Table(FooBar, meta.metadata, ... Column(created, DateTime(), default=datetime.datetime.now), Column(modified, DateTime(), default=datetime.datetime.now, onupdate=datetime.datetime.now), ... ) All work great. However, my

Re: [sqlalchemy] How can I change manually the value of field with onupdate option ? I would like override onupdate mechanism

2010-10-28 Thread Alexandre Conrad
Not sure on this one, but are you passing a formatted date string? Maybe you should set a datetime object directly and let SA do the string conversion during flush. Alex Sent from my fantastic HTC Hero On Oct 28, 2010 1:41 AM, KLEIN Stéphane klein.steph...@gmail.com wrote: Hi, in my project,

Re: [sqlalchemy] How can I change manually the value of field with onupdate option ? I would like override onupdate mechanism

2010-10-28 Thread Thadeus Burgess
I actually have this same issue as well.. I have a field that means the record has been tested. Any updates to the field make tested = False, all except for one other field. However when I updated that field and this field it still gets reset to false.. record.approved=True record.tested=True

Re: [sqlalchemy] How can I change manually the value of field with onupdate option ? I would like override onupdate mechanism

2010-10-28 Thread Thadeus Burgess
The only way around this is to do two separate commits record.approved = True db.session.commit() record.tested = True db.session.commit() record.approved is True record.tested is True -- Thadeus On Thu, Oct 28, 2010 at 2:22 PM, Thadeus Burgess thade...@thadeusb.comwrote: I actually have

Re: [sqlalchemy] How can I change manually the value of field with onupdate option ? I would like override onupdate mechanism

2010-10-28 Thread Michael Bayer
again, no reason why that should be the case from an ORM perspective, please provide a succinct and full working test case and I can evaluate what you're doing. On Oct 28, 2010, at 3:24 PM, Thadeus Burgess wrote: The only way around this is to do two separate commits record.approved = True