#18614 closed Cleanup/optimization (fixed)
https://docs.djangoproject.com/en/1.4/topics/forms/ missing some sample code
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | 1.4 |
Severity: | Normal | Keywords: | from csrf missing imports |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
The first two examples should include example file names that the code might be inside, since we might be new to the whole model / view concept.
in https://docs.djangoproject.com/en/1.4/topics/forms/#using-a-form-in-a-view
example is missing import statements for HttpResponseRedirect and render_to_response
example's final return is missing context_instance=RequestContext(request) after the dictionary, or a note needs to be made about this when explaining {% csrf_token %}. import path should also be referenced.
Change History (6)
follow-up: 2 comment:1 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Bug → Cleanup/optimization |
follow-up: 3 comment:2 by , 12 years ago
Replying to aaugustin:
Replying to xarses@…:
The first two examples should include example file names that the code might be inside, since we might be new to the whole model / view concept.
We don't generally include file names in code samples, maybe because Django leaves a lot of flexibility on code layout. You're supposed to have gone through the tutorial first and be familiar with models, views and templates.
Alright, doesn't matter that much, been reading some of the other db examples and they have been saying stuff along the lines of "your model ... {code block}.
Yes I've read the tutorial but still like to get a better idea of what this blob is supposed to represent.
in https://docs.djangoproject.com/en/1.4/topics/forms/#using-a-form-in-a-view
example is missing import statements for HttpResponseRedirect and render_to_response
example's final return is missing context_instance=RequestContext(request) after the dictionary, or a note needs to be made about this when explaining {% csrf_token %}. import path should also be referenced.
Yes, we should include import paths, and switch to
render
while we're there.
comment:3 by , 12 years ago
Has patch: | set |
---|
comment:4 by , 12 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:5 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Replying to xarses@…:
We don't generally include file names in code samples, maybe because Django leaves a lot of flexibility on code layout. You're supposed to have gone through the tutorial first and be familiar with models, views and templates.
Yes, we should include import paths, and switch to
render
while we're there.