django - TemplateSyntaxError caught DoesNotExist while iterating through a forloop on a populated list of forms -
I am following this useful article. Unfortunately, that does not indicate the template code, so I'm guessing there.
I want to add several types of formats to a single model in one page, with some common property set, in either form or in the variables of the page or at the top of the page. This is for a teacher's market.
My thoughts:
def record_assessments (request, teaching group, purpose): theclass = TeachingGroup.objects.get (name__iexact = teachinggroup)) students = pupil.objects. Filter (teaching_group = theclass) theobjective = Objective.objects.get (code = objective) thedate = datetime.date.today () if request.method == 'POST': aforms = [PupilAssessmentForm (POOT request, prefix = xid , Instant = Assessment ()) For students in X if all (for F.I.I.VIDID) (for AFFF): For F.Formes: new_record = af.save (commit = False) new_record .objective = theobjectiv E new_record.date = thedate new_record.save () Redirection redirect ("/ app /" + theclass + "/" + marksheet + "/" + theobjective.strand.code | bottom + "/") Other: forms = [PupilAssessmentForm (Prefix = str (x.id)) for students in x Return] render_to_response ('recordassessments.html', local ()) I have not managed to check if the loop In logic, as I have not managed to properly post the form so far
If I put
else: aforms = [PupilAssessmentForm (prefix = str (x.id), instance = x) then the page presents properly. ] But then I'm building model models with model models for an object in the student model, which seems wrong.
My Template:
{% in format for%} & lt; Form action = "method =" post "& gt; {{Af.instance}} {{af.errors}} & lt; P & gt; {{Eff}} {% endfor%} & lt; Input type = "submit" value = "submit" & gt; & Lt; / Form & gt; Error (selected snippet): Exception type: TemplateSyntaxError Exception value: caught NotNotExist while rendering: Error on line 20 Caught Do NotExist while rendering: 20% {% for aforms%} in <% code > and yet the list of forms appears in the Page Variable:
aforms [& lt; Two.app.forms 0x21db050 & gt; 0x21db650 & gt;] on
0x21db0d0 at & amp; Gt; And & lt; Pup.AssificationForm object; Strange, Django Dieses do not throw away the Noxxist while presenting the models ... But .... you are providing a form. I suggest that you have to do some investigation for the result in your idea code You can be sure that you are getting results in students and your other questions.
Comments
Post a Comment