On May 7, 2008, at 5:15 PM, David Gardner wrote:

>
> Tried that still no luck. If it helps any, the job_info table is
> temporary and doesn't have any keys, or foreign keys, since it is  
> being
> constantly updated. So I am doing the join in my mapper:
>
> qstat_mapper = mapper(JobInfo, qstat_table,
> primary_key=[qstat_table.c.job_number], properties={
>                      'Chunk':relation(Chunk, lazy=True, uselist=False,
>
> primaryjoin=chunk_table.c.queue_job_id==qstat_table.c.job_number,
>                       foreign_keys=[chunk_table.c.queue_job_id])})
>


if a plain eager load works here, then the contains_eager() option  
should work as well.    if you are joining to an alias of the joined  
table, that needs to be sent to contains_eager() as well.

If a plain eager load does *not* work, then you have to get that going  
first (and for that, you have to ensure that at least a *lazy* load  
works).  temp table/no pks/no fks have no impact here since you are  
defining those things on your mapper.

Feel free to produce a standalone script using sqlite illustrating the  
table structure, ORM setup, and ORM query you're trying to do.


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