On Nov 3, 2008, at 5:10 PM, john.goodleaf wrote:
> > I'd like to map to a selectable, but that selectable should contain > the result of a scalar function. I'm unsure how best to accomplish it. > In raw SQL, I'd write something like: > select P.SubjectId, > P.SubjectName, > V.VariableName, > D.RecordID, > D.Data, > dbo.fnLocalizedInstanceName('eng', I.InstanceID) as > InstanceName <--- Here's the function > <from a bunch of joined tables> > > I want this ORM'd, but I'm not sure where or how to invoke the > localization function. Is it better done in the Table definition? How? > Is this something I can put in the mapper() function? Basically, > instead of the reflected column, I want to retrieve the result of a > function? > > This is probably easy, but I haven't found it in the docs yet. > Thanks, use column_property() in conjunction with func.dbo.fnLocalizedInstanceName('eng', column). Some docs are in the "mapper" chapter of the docs. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---