On Apr 17, 2008, at 5:51 PM, jean-philippe dutreve wrote:

>
> class AccountLoader(MapperExtension):
>    def append_result(self, mapper, selectcontext, row, instance,
> result, **flags):
>        isnew = flags.get('isnew', False)
>        if instance.parent_id is None:
>            result.append(instance)
>        else:
>            if isnew or selectcontext.populate_existing:
>                key =
> mapper.identity_key_from_primary_key(instance.parent_id)
>                parentnode = selectcontext.session.identity_map[key]
>                parentnode.children.append(instance)
>        return False
>
> accounts = Session.query(Account).filter(Account.c.chart_id==1).all()

i cant see any problem from what I see here.  The example script  
definitely works and append_result is called, so just try to see  
what's different here vs. that script, and try stepping through with  
pdb for more detail.  If all else fails, send along a full reproducing  
test case.


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