Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#18614 closed Cleanup/optimization (fixed)

https://docs.djangoproject.com/en/1.4/topics/forms/ missing some sample code

Reported by: xarses@… 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)

comment:1 in reply to: ↑ description ; follow-up: Changed 3 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted
  • Type changed from Bug to Cleanup/optimization

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.


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:2 in reply to: ↑ 1 ; follow-up: Changed 3 years ago by xarses

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:4 Changed 3 years ago by jezdez

  • Triage Stage changed from Accepted to Ready for checkin

comment:5 Changed 3 years ago by Florian Apolloner <florian@…>

  • Resolution set to fixed
  • Status changed from new to closed

In [7d06f975fe445f0393455b3eb9ec17dbe04f2ec3]:

Fixed #18614 -- Added missing imports in code samples.

comment:6 Changed 3 years ago by Kevin London <kevinlondon@…>

In [c6d06a9453859c5520312454b6353498332ff838]:

[1.4.x] Fixed #18614 -- Added imports and changed render_to_response to render.

Note: See TracTickets for help on using tickets.
Back to Top