Michael,

Michael Bayer wrote:
> 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).
>   
Thanks for the quick reply.

I started working on a wxPython demo/sample app using SA and want to use 
sqlite for it (to keep the dependencies down), so will just have to 
change the demo data loading to use table objects.

Werner
>
> >
>
>
>   


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to