Re: Quick syntax query - translating a piece of API code for use in a django view

2009-10-09 Thread Eva Hamilton
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

Re: Quick syntax query - translating a piece of API code for use in a django view

2009-10-09 Thread Bogdan I. Bursuc
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

Re: Quick syntax query - translating a piece of API code for use in a django view

2009-10-09 Thread Daniel Roseman
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()

Re: Quick syntax query - translating a piece of API code for use in a django view

2009-10-09 Thread Bogdan I. Bursuc
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

Re: Quick syntax query - translating a piece of API code for use in a django view

2009-10-09 Thread Eva Hamilton
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"

Re: Quick syntax query - translating a piece of API code for use in a django view

2009-10-09 Thread 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

Quick syntax query - translating a piece of API code for use in a django view

2009-10-09 Thread Eva Hamilton
>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