On Oct 3, 2008, at 5:39 AM, [EMAIL PROTECTED] wrote:
>> B joins to A1 on A1.db_id, which is not the primary key of the "A" >> mapper series. the PK is A0.db_id. thats how it does that part. > i've no manual code, whatever relation is producing. > they're same, no? at least A0.ids contains all A1.ids, any A1 is an A0 > as well. > a) how i make it so the relation uses A0.db_id and not A1.db? i guess > by linking to A0 instead of A1... but i don't want that. thats the only way, yeah > > b) what is the equivalence checking algo, if any, done by > propLoader/query.get() ? to me something there is not correct. it > should, for a A0-A1-A2-A* inheritance chain, when asked for any of > (A1,A2,A*).id to check for the root A0.id. right? it checks for a join condition of B.some_foreign_key_column(s) == A.the_primary_key_column(s). If it knows that, then A can be loaded by primary key hence get(). > heh, as i see it, the propLoader is not doing query.get()... > > in LazyLoader.init(): > self.use_get = not self.uselist and > self.mapper._get_clause[0].compare(self.__lazywhere) > > it compares > mapper: "A0".db_id = ? > lazyrel: ? = "A1".db_id > and they are not equivalent.. this should first replace A1.dbid with > it's corresponding mapper's root key (A0.dbid) via > _equivalent_column/corresp_column and just then compare. > right? i'll make a ticket #1186 +test. that is exactly correct, that approach would work. --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---