#22969: Forms show_hidden_initial not is_valid() and fix => lost changes in
valid
fields
-------------------------------------+-------------------------------------
Reporter: dibrovsd@… | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.6
Severity: Normal | Resolution:
Keywords: Form | Triage Stage:
show_hidden_initial changed_data | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by dibrovsd@…):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Other example
view
{{{
def test(request):
u""" for debug and test's """
from django.forms import Form, CharField
class MyForm(Form):
req_field = CharField(show_hidden_initial=True, required=True)
notreq_field = CharField(show_hidden_initial=True, required=False)
if request.method == 'POST':
form = MyForm(data=request.POST)
if form.is_valid():
for field_name in form.changed_data:
print field_name
else:
form = MyForm()
return render(request, 'test.html', {'form': form})
}}}
template
{{{
<form method='post'>
{% csrf_token %}
{{form.as_p}}
<input type="submit">
</form>
}}}
script:
1. Load page, set notreq_field = '12' and submit form
2. Fix error (set req_field = '12') and submit form
3. console print is "req_field"
--
Ticket URL: <https://code.djangoproject.com/ticket/22969#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/076.231380c79284081c743f2190e4cb933f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.