Thanks, both of you - I get it now.
On Oct 9, 6:22 pm, "Bogdan I. Bursuc"
wrote:
> I know the shell and view are the same i meant the view and the template
> are different, you didn't specify the brackets after the all method
> like: all(), this because your might be used with the template synta
I know the shell and view are the same i meant the view and the template
are different, you didn't specify the brackets after the all method
like: all(), this because your might be used with the template syntax, I
made this mistake, too. That why i was telling you about the difference
between view
On Oct 9, 9:06 am, Eva Hamilton wrote:
> Oops, sorry, that's a typo in the post - but not present in the actual
> code.
>
> It should have read...
>
> world = Species.objects.all.select_related()
No, it shouldn't. Compare your original:
> > > >>> world = Species.objects.all().select_related()
In the view the syntax is
world = Species.objects.all().select_related()
see the brackets after the all method.
only when you use the code in the template you don't put brackets for a
method/function.
On Fri, 2009-10-09 at 01:06 -0700, Eva Hamilton wrote:
> Oops, sorry, that's a typo in the pos
Oops, sorry, that's a typo in the post - but not present in the actual
code.
It should have read...
world = Species.objects.all.select_related()
family_list = [o.genus.family for o in world]
Or is there another missing ")" that I'm not seeing?
Thank you!
On Oct 9, 5:18 pm, "Bogdan I. Bursuc"
You forgot a ")" sign. That's why syntax error.
On Thu, 2009-10-08 at 23:48 -0700, Eva Hamilton wrote:
> >From the django documentation (here:
> >http://www.djangoproject.com/documentation/models/select_related/)
> I obtained this bit of code for performing a select_related on a list
> of object
>From the django documentation (here:
>http://www.djangoproject.com/documentation/models/select_related/)
I obtained this bit of code for performing a select_related on a list
of objects and producing a list of related objects...
>>> world = Species.objects.all().select_related()
>>> [o.genus.fa
7 matches
Mail list logo