Hey,

Thanks very much for looking into this. I'm sorry I couldn't offer more 
specific suggestions earlier - my goal was just to start the thought 
process leading to such suggestions (also in myself), and at this point 
you're still a lot more familiar with this codebase than I am. :)

I'm happy the discussion ended up leading to this improvement. The 
backref story indeed looks like an improvement as less knowledge about 
this has to be in different areas of the code.

I do still have some questions about your suggested code:

Michael Bayer wrote:
> class MyRelation(RelationProperty):
> 
>     def _determine_joins(self):
>         self.primaryjoin = join_condition(self.parent.local_table,
> self.target) & (self.parent.local_table.c.id>0)

The code in the baseclass version of _determine_joins isn't used at all 
in your example. But this code appears to handle various cases:

* raising an exception if secondary is None when self.secondaryjoin isn't

* finding a join condition to the mapped_table in the case of some 
inheritance conditions

* handling the cases where secondary is provided in the case of a MANY 
to MANY relationship

* raise an error if join conditions couldn't be determined.

In order to handle all these cases I think in my subclass I'd need to 
handle them too.

In addition I'm curious what _orm_deannotate does and why deannotating 
the extra clause isn't needed in this case.

Regards,

Martijn


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to