atom feed4 messages in com.googlegroups.django-usersTemplate error "Could not parse the r...
FromSent OnAttachments
SpiderJul 12, 2006 9:08 am 
James BennettJul 12, 2006 9:18 am 
Brett ParkerJul 12, 2006 9:32 am 
SpiderJul 12, 2006 9:37 am 
Subject:Template error "Could not parse the remainder"
From:Spider (matt@cuneiformsoftware.com)
Date:Jul 12, 2006 9:08:59 am
List:com.googlegroups.django-users

I have this loop in a template : {% for s in p.schedule_set.all() %}

The template engine complains with "Could not parse the remainder: ()"

Here p is a Plan object instance. Schedule has Plan as a many-to-one foreign key (each Plan has 1 or more Schedules).

What I want is to loop through all the Schedules associated with this Plan. I know that p.schedule_set.all() gives me this, so I guess this is a limitation of the template parser. Is there a way to achieve what I want?

I did think of doing the p.schedule_set.all() in my view and passing the result in, but there problem is that there is a further level of nesting - each schuled consist of a number of visits, so notionally what I want is nested loops : {% for s in p.schedule_set.all() %} {% for v in s.visit_set.all() %}

I suppose I could pass in nested dictionaries from the view ...