Re: foreign key help

2011-02-13 Thread Tom Evans
On Sun, Feb 13, 2011 at 8:04 PM, Tom Evans wrote: > Your Disposition object has now __unicode__ method, which is how the 'has *no* __unicode__ method' Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: foreign key help

2011-02-13 Thread Tom Evans
On Sun, Feb 13, 2011 at 7:54 PM, Bobby Roberts wrote: > class Disposition (models.Model): >        id = models.AutoField (primary_key=True) >        name = models.CharField (max_length=50, blank=False, > db_index=True) >        active = models.IntegerField(blank=False, > choices=active_choices) >

foreign key help

2011-02-13 Thread Bobby Roberts
class Disposition (models.Model): id = models.AutoField (primary_key=True) name = models.CharField (max_length=50, blank=False, db_index=True) active = models.IntegerField(blank=False, choices=active_choices) order = models.IntegerField(blank=True, default=0) class D

Re: need foreign key help quick

2009-11-08 Thread Karen Tracey
On Sat, Nov 7, 2009 at 8:39 PM, Bobby Roberts wrote: > > Hi. I have never used foreign keys I need to start and I need > help. I'm running python2.5 and django1.1. I have an installation > of Satchmo running fine; however, I need to modify the Product table. > I need to tie fields from th

Re: need foreign key help quick

2009-11-08 Thread Rishabh Manocha
On Sun, Nov 8, 2009 at 9:41 PM, Bobby Roberts wrote: > > anyone out there that can help me? > > On Nov 7, 8:39 pm, Bobby Roberts wrote: > > Hi. I have never used foreign keys I need to start and I need > > help. I'm running python2.5 and django1.1. I have an installation > > of Satchmo r

Re: need foreign key help quick

2009-11-08 Thread Bobby Roberts
anyone out there that can help me? On Nov 7, 8:39 pm, Bobby Roberts wrote: > Hi.  I have never used foreign keys I need to start and I need > help.  I'm running python2.5 and django1.1.   I have an installation > of Satchmo running fine; however, I need to modify the Product table. > I need

need foreign key help quick

2009-11-07 Thread Bobby Roberts
Hi. I have never used foreign keys I need to start and I need help. I'm running python2.5 and django1.1. I have an installation of Satchmo running fine; however, I need to modify the Product table. I need to tie fields from the Product module to fields in another module outside of satchmo.

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