forms.CharField(widget=forms.HiddenField)

On Oct 21, 2017 12:45 AM, "gugsrs" <rsiqueira.gust...@gmail.com> wrote:

Hello,

I am having some problems with django 1.11 widgets, I was using
django-widget-tweaks to help rendering form fields,
but now when I set a type="hidden" attribute to an Input Field, django
creates the widget with both type="text" and type="hidden" attributes.
That happens because when the widget is initialized [1] it's input_type is
set from the attrs.
But when the widget is rendered and the method get_context is called, it
uses the old input_type attr, and not the new one that is sent[2] in attrs.

Is this some kind of bug or am I missing something?

Regards,

Gustavo

[1] https://github.com/django/django/blob/1.11.6/django/
forms/widgets.py#L271
[2] https://github.com/django/django/blob/1.11.6/django/
forms/widgets.py#L276

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/
msgid/django-users/cac48b38-6709-4307-b097-33c3c1076594%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/cac48b38-6709-4307-b097-33c3c1076594%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACOk0TxyT4p-n9%3D1b3d8nc40R3EHwpwfKiMfq4DxGORpBh6Syg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to