I have this in my model: class Machine(models.Model): name = models.CharField(max_length=100) cpuInfo = models.ForeignKey(Cpu, blank=True, null=True)
class Cpu(models.Model): l = models.CharField(max_length=50) num = models.IntegerField() so basically I add machines to the Machine table and then loop through each and find out the processor type and num. I want to insert and attach it to the machine but I'm confused on how to do this? Can someone show me the syntax? procType = 'intel' numProcessor = 4 for e in Machine.objects.all(): print e.name --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---