On Thu, Aug 6, 2015 at 6:55 PM, <
durir...@gmail.com> wrote:
> So, I'm trying to use inputs with the hidden attr. I have my form class
> (IndexForm) that has this:
> field = HiddenInput()
> Then, I pass the instance of IndexForm (index_form) to the template, and
> manually render the field (index_form.field). It is alright, but then, in
> the HTML, the render of the field is this...
> <django.forms.widgets.HiddenInput object at 0xb6076dcc>
> Why I'm seeing the str representation of the object, and not an HTML hidden
> input?
Forms are collections of Field instances, but HiddenInput is a Widget.
You should be setting the widget attribute of one of the fields to be
a HiddenInput, not assigning a HiddenInput as a member of the form.
Cheers
Tom