On Aug 24, 2008, at 6:42 AM, Werner F. Bruhin wrote:
> > I have this in my model: > > sa.Column(u'created', sa.Date(), default=sa.func.now()), > sa.Column(u'updated', sa.Date(), onupdate=datetime.datetime.now), > > But the dates don't get updated when I do: > > langtable = [ > """INSERT INTO LANGUAGE (LANGID, NAME, LOCALES) VALUES (1, 'English', > 'en')""", > .... etc > ] the onupdates and such related to a Table only take effect when you use the Table object itself to generate the INSERT statement, not a plain string. If you want the database to always do something when an INSERT happens regardless of its source, you'd have to configure a trigger in your database (which sqlite does support). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---