Re: NewBie Question about ForeignKey relationships

2009-01-07 Thread Mark Jones
Thanks for the pointer, I had read all around that. The short version is: maker.auto_set.all() There was was Dry(er) more elegant method to be found. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: NewBie Question about ForeignKey relationships

2009-01-07 Thread Karen Tracey
On Wed, Jan 7, 2009 at 8:26 PM, Mark Jones wrote: > > Ok, here is some simple code: > > class Maker(models.Model): >name = CharField(max_length=20) > > class Auto(models.Model): >name = CharField(max_length) >maker = ForeignKey(Maker) > > > maker = Maker.objects.get(pk=1) > > How do I

NewBie Question about ForeignKey relationships

2009-01-07 Thread Mark Jones
Ok, here is some simple code: class Maker(models.Model): name = CharField(max_length=20) class Auto(models.Model): name = CharField(max_length) maker = ForeignKey(Maker) maker = Maker.objects.get(pk=1) How do I get all the Autos made by this maker I don't see a maker.autos (rails