Hi,

> VulnResDesc.mapper.add_property('rawvulns', sao.relation(VulnRes.mapper,
>     primaryjoin = sa.and_(VulnRes.targetid == VulnResDesc.targetid,
>                        VulnMap.vulndescid == VulnResDesc.id,
>                        VulnMap.tool == VulnRes.tool,
>                        VulnMap.toolvulnid == VulnRes.toolvulnid),
>     foreign_keys = [VulnResDesc.c.targetid, VulnResDesc.c.id],
>     viewonly = True,
>     uselist = True))
>
> ultimately all relations distill the join condition into a set of pairs,
> above it would be:
> [ (VulnResDesc.targetid, VulnRes.targetid) ]
>

I still don't quite understand this I'm afraid, I though there were more
columns involved - VulnResDesc.id, VulnRes.tool, VulnRes.toolvulnid.


> So using foreign_keys which only deals with these columns should probably
> work by itself:
> foreign_keys = [VulnResDesc.targetid]
> The remote_side argument, if needed, would be remote_side=
> [VulnRes.targetid] since that is the "right" side of the relation.
>

Ok, if I set foreign_keys like that, it doesn't ask me for a remote_side,
BUT when I come to actually use the relation, the query runs for a long
time, in fact my web app times out before it completes.

Have you got any other suggestions? I am pretty damn stuck here. And the
bugger is, this used to work just fine!

Paul

--~--~---------~--~----~------------~-------~--~----~
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