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"
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
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
3 matches
Mail list logo