mdoar wrote: >> i think you mean to say here that foreign_keys=Defect.state. if the >> foreign keys are on the "other" side, thats one to many. > > I do indeed have it set up as one to many and then I get the first > instance. > Does that change the solution?
in that case SQLA doesn't have what it needs to load the existing instance without SQL. it must locate the remote instance by finding rows that reference the local id and the session does not cache items by foreign key. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---