Opened 18 years ago
Closed 18 years ago
#3005 closed defect (fixed)
[patch] Manipulators and forms documentation uses do_html2python in the wrong place (new-admin changes)
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Documentation | Version: | |
Severity: | major | Keywords: | |
Cc: | gary.wilson@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Manipulators and forms docs fails in order of doing do_html2python. If validation fails, the new_data is not converted from html to python, and for example it causes this: When you send a form and validation fails, templates doesnt show old values in selects fields.
The problem is this code:
# Check for validation errors errors = manipulator.get_validation_errors(new_data) if errors: return render_to_response('places/errors.html', {'errors': errors}) else: manipulator.do_html2python(new_data) new_place = manipulator.save(new_data) return HttpResponse("Place created: %s" % new_place)
the correct code is this (changes order of do_html2python):
# Check for validation errors errors = manipulator.get_validation_errors(new_data) manipulator.do_html2python(new_data) if errors: return render_to_response('places/errors.html', {'errors': errors}) else: new_place = manipulator.save(new_data) return HttpResponse("Place created: %s" % new_place)
Attachments (1)
Change History (9)
by , 18 years ago
Attachment: | forms.patch added |
---|
comment:1 by , 18 years ago
Summary: | Manipulators and forms docs fails in order of do_html2python → [patch] Manipulators and forms docs fails in order of do_html2python |
---|
comment:2 by , 18 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I'm marking this as a wontfix, because the forms system is being rewritten (see django.newforms in trunk), and this wouldn't be worth fixing.
comment:3 by , 18 years ago
i knew newsforms package, but though old forms has deprecated, developers still can to commit errors in code :_(
i think it would be good if we correct this docs.
comment:4 by , 18 years ago
Cc: | added |
---|---|
Resolution: | wontfix |
Status: | closed → reopened |
Not worth fixing?! Much more time is being wasted by people having problems with this (and helping people with this problem) than the 30 seconds it would take to apply the simple patch. Also, I am marking #2757 (a ticket I opened almost 2 months ago) as a dup of this ticket since the patch here is more up to date (the flatten_data()
was already fixed in [3758]).
It is this sort of stuff that makes contributors not so happy inside :(
comment:5 by , 18 years ago
Summary: | [patch] Manipulators and forms docs fails in order of do_html2python → [patch] Manipulators and forms documentation uses do_html2python in the wrong place (new-admin changes) |
---|
comment:7 by , 18 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
Adrian--though newforms is on the way, this is a simple doc-only patch, and wrong docmentation makes a bad impression.
The patch still applies (cd django/docs; patch -p0). I doublechecked it with the generic create_update view.
comment:8 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Patch in documentation