On Sun, Oct 5, 2008 at 8:56 AM, Michael Bayer <[EMAIL PROTECTED]> wrote:
>
> you can use strings with Python in them when you use declarative even
> with args like primaryjoin, so you could say things like:
>
> class Policy(DeclarativeBase):
> __tablename__ = 'policy'
>
> policy_state =
> relation('State',backref='state_policies',primaryjoin="Policy.state_of_policy_code==State.code")
> domicile_state =
> relation('State',backref='domicile_policies',primaryjoin="Policy.state_of_domicile_code==State.code")
>
> this would eliminate the need to have your classes in a particular
> order.
>
> Its documented about a third of the way down at
> http://www.sqlalchemy.org/docs/05/plugins.html#plugins_declarative .
Thanks for pointing out the string syntax, I must have miss that.
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---