> -----Original Message----- > From: sqlalchemy@googlegroups.com > [mailto:sqlalch...@googlegroups.com] On Behalf Of Crusty > Sent: 24 September 2009 16:16 > To: sqlalchemy@googlegroups.com > Subject: [sqlalchemy] Re: unexpected chained relations and > "append" behaviour > > > Hello Simon, > > thanks for your answer, I will have a look into that. > By the way: len(car.parts) does indeed work, try it ;) > > Greetings, Tom >
len(car.parts) works with your current configuration, because accessing car.parts loads the entire relation and returns it as a python list. But if you change it to be a 'dynamic' relation, it will no longer be a list but a Query instance, which no longer has a __len__ method. Simon --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---