On Apr 5, 10:32 am, "vinjvinj" <[EMAIL PROTECTED]> wrote:
> > a = user_table()
> > a.a_column_in_user_table_1  + a.additional_info.your_column
>
> My logic is not as simple as (a.a_column_in_user_table_1  +
> a.additional_info.your_column). It's about 20 lines of code. Also I'm
> trying to understand how you would add additional attributes to a
> python User object which is set up by the sqlalchemy mysql object.
>
> Vineet

Just thinking about it, this should work:

def class User(object):
    get_calculated_field(self):
        return self.a_column_in_user_table_1  +
self.a_column_in_additional_info
    calculated_field = property(get_calculate_field)

If that works how can I pass a custom sql (in raw form) to a mapper
object for class user:

mapper(User, "some custom sql")

Thanks,

Vineet


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
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