django admin delete oneToOneField ?

2009-06-17 Thread Dan Sheffner
ok so I have a list of servers that have a one to one relationship with a table called cpu. When I delete a server from the server table it should also delete it one to one relationship with the cpu entry. right? do I need to pass something extra in the models.py to have this happen? --~--~

Re: Saving Foreign Key Help

2009-06-17 Thread Dan Sheffner
0: print "no object adding:" processor = Cpu.objects.create(l=procType, num=numProcessor) machineObject = Machine.objects.get(name=server) machineObject.cpuInfo = processor machineObject.save() On Wed, J

Re: Saving Foreign Key Help

2009-06-17 Thread Dan Sheffner
me=server) machineObject.cpuInfo = processor machineObject.save() On Wed, Jun 17, 2009 at 1:28 PM, J. Cliff Dyer wrote: > > On Wed, 2009-06-17 at 12:55 -0500, Dan Sheffner wrote: > > I have this in my model: > > > > class Machine(models.

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

Re: django "Unknown column 'inventory_machine.serial_num error

2009-06-17 Thread Dan Sheffner
This was because I had bad sys.path.append directories hidden in a global file. Fixed this to point to right directory and all problems went away. Wish I had the last 24 hrs back though :( On Tue, Jun 16, 2009 at 6:26 PM, thesheff wrote: > I have cleaned up my model view and I thought for sure