Re: Saving Foreign Key Help

2009-06-17 Thread Dan Sheffner
ok Fixed it. Thanks for the help your example def helped. I have been banging my head for awhile :) def processor(self): self.machineList = Machine.objects.values_list('name', flat=True).filter(typeInfo__l__exact="Linux Server") for server in self.machineList: numProc

Re: Saving Foreign Key Help

2009-06-17 Thread Dan Sheffner
Yes so I start with machines and then I find out what CPU's they have and add them to the database. I get this error: TypeError: 'Cpu' object is not iterable So this is what I have so far: def processor(self): self.machineList = Machine.objects.values_list('name', flat=True).filter(type

Re: Saving Foreign Key Help

2009-06-17 Thread J. Cliff Dyer
On Wed, 2009-06-17 at 12:55 -0500, Dan Sheffner wrote: > 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) >

Saving Foreign Key Help

2009-06-17 Thread Dan Sheffner
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 Machi