Michael, Michael Bayer wrote: > On Oct 10, 2007, at 5:56 AM, Werner F. Bruhin wrote: > > >> Looking at the doc for 0.4 I see that I should be able to do this: >> >> result = engine.execute("select username from users") >> ... do something with the result >> result.close() >> >> But I am getting the following exception. Note that I am using >> Firebird >> SQL and the firebird.py is the one patched by Roger. >> >> Am I doing something wrong or is this not supported in 0.4? >> >> BTW, I would like to use this within a custom type ("class >> MyType(types.TypeDecorator):" to do the I18N translation similar to >> what >> Karsten suggested in another thread. >> >> > > it looks like you are trying to execute SQL inside of a TypeEngine's > convert_result_value() method. the argument passed to that is > currently a Dialect, not an engine (also, issuing SQL inside of > convert_result_value(), not such a great idea in general...) > Yes, I was calling a Stored Procedure to get a translation for the original value of that column.
Could you give me some hints on how I could do the following in SA. - define a column as I18N (actual value is a varchar) - when the column is read take the value from the table column, do a lookup with it in the i18n translation table with a stored procedure and either return what was found or the original value - the column should ideally be read only - to be able to maintain the column I was thinking of setting up a second model for the same table where the i18n column would be defined as varchar to allow to set the value to be translated I would really appreciate if you could push me in the right direction on this. Thanks and best regards 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 -~----------~----~----~----~------~----~------~--~---