Michael Lake schreef:
<snip>
> Yes it does work, thanks heaps. I presume though that the render_to_return is
> outside
> of the previous for loop as below.
Yes it's outside the loop as you already found out.
> for e in experiment_list:
> e.proc_count = e.experiment_procedure_set.all().count()
>
> return render_to_response('lab/experiments.html',
> {'experiment_list': experiment_list,
> 'ecount': ecount,
> })
>
> Anyhow with the above I now get the correct list of procs for each
> experiment. So
> what's happening I understand is that I'm creating a new attribute or method
> of the
> object e called .proc_count by simply assigning e.proc_count a value?
Yes indeed, that's what happens. It's an easy way to "transport" extra
data to your templates.
Glad it worked.
Regards,
Benedict
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---