hi Folks I have a model which has in it some stuff that looks like:
class Simulation(models.Model): ... boundaryCondition=models.ManyToManyField ('SimCoupling',blank=True,null=True) ... class Coupling(models.Model): ... class SimCoupling(models.Model): ... original=models.ForeignKey(Coupling) ... In the shell I can do > from protoq.models import * > s=Simulation.objects.get(id=13) > bc=s.boundaryCondition and obviously bc is a manytomany manager. Now, what I want to do is loop over those boundaryCondition related objects. I understand how to get a list of dictionary versions, but I want the actual SimCoupling instances themselves. I thought I could get the query set and just ask for the objects ... but: >>> bc.values() [{'targetInput_id': 1, 'component_id': 1, 'couplingFreqUnits_id': 19, 'couplingType_id': 14, 'original_id': 1, 'manipulation': u'asdf', 'id': 28, 'couplingFreq': 122}] >>> bc.all() [] >>> bc.get_query_set() [] >>> bc.get_query_set().all() [] >>> bc.get_query_set().values() [{'targetInput_id': 1, 'component_id': 1, 'couplingFreqUnits_id': 19, 'couplingType_id': 14, 'original_id': 1, 'manipulation': u'asdf', 'id': 28, 'couplingFreq': 122}] I think I'm being stupid, and having one of those "woods and trees" moments. How do I get to a list of the objects or something I can iterate over? I know it's going to be obvious, and last week I probably knew it ... :-( (I wanted to be able to get a list like this: bclist= [m.original for m in bc.something] I know I can get this the hard way from the dict ... but ...) Thanks in advance, Bryan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---