I am iterating over a formset made of modelforms in my template. I want to provide aditional information on that model. If the answer to this How to Access model from Form template in Django question would work, i could do this:
{% for form in formset.forms %}
Status:{{ form._meta.model.status }}
{{form}}
{% endfor %}
But that just throws the TemplateSyntaxError: Variables and attributes may not begin with underscores.
I don’t think that’s what you want to do. A model is a class: it won’t have a
status, as that’s a field which only gets a value for a particular instance.I suspect what you mean to do is access the model instance associated with the form, which is just
form.instance.