Thursday, August 6, 2015

Issue when rendering manually a form's HiddenInput

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?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4ec95c50-8eca-4999-bd80-62e960de3b38%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment