because SurveySession extends from TreeNode, you have to disambiguate
SurveySession.id from TreeNode.id:
class SurveySession(TreeNode):
__tablename__ = "session"
__mapper_args__ = dict(polymorphic_identity="session")
survey_id = schema.Column('id', types.Integer(), primary_key=True,
autoincrement=True)
make your survey relation in terms of SurveySession.survey_id.
On May 19, 2009, at 10:17 AM, Wichert Akkerman wrote:
>
> Previously Michael Bayer wrote:
>>
>>
>> On May 18, 2009, at 7:01 AM, Wichert Akkerman wrote:
>>
>>>
>>> session = orm.relation("SurveySession", cascade="all",
>>> remote_side=["SurveySession.id"],
>>> primaryjoin="SurveySession.id==TreeNode.session_id")
>>> parent = orm.relation("TreeNode", cascade="all",
>>> remote_side=["TreeNode.id"],
>>> primaryjoin="TreeNode.id==TreeNode.parent_id")
>>
>> you want to say 'remote_side="TreeNode.id"' here, or
>> 'remote_side="[TreeNode.id]"'. Or just 'remote_side=id'. the
>> argument to remote_side is one of: 1. a string that is evaluated
>> entirely 2. a column 3. a list of columns
>
> Doing that for the remote_side for the parent relation results in the
> exact same error unfortunately.
>
> Wichert.
>
> --
> Wichert Akkerman <[email protected]> It is simple to make things.
> http://www.wiggy.net/ It is hard to make things
> simple.
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---