Code

Opened 21 months ago

Last modified 21 months ago

#19106 new New feature

Add new tutorial on breaking templates into blocks

Reported by: cirosantilli Owned by: nobody
Component: Documentation Version: 1.4
Severity: Normal Keywords: template, tutorial, extend
Cc: Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi,

I suggest you use the

  • extends template
  • base.html
  • the conventional title, extrahead, content_title, content, etc. blocks

combo from for the polls tutorial from the start when the template language is first used in

https://docs.djangoproject.com/en/1.4/intro/tutorial03/

since this is an absolutely fundamental design pattern.

While the "do simple now and improve later" strategy could be used (in tutorial 5, we say: wow, lets refactor some more code!), I think the direct approach is better here, since it is pretty obvious that this factors out the code.

Attachments (0)

Change History (1)

comment:1 Changed 21 months ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from Feature request: case change on visual mode with tilde to Add new tutorial on breaking templates into blocks
  • Triage Stage changed from Unreviewed to Someday/Maybe
  • Type changed from Uncategorized to New feature

I disagree - the "simple and improve later" is a much better idea.

It's easy to explain simple things. Once the basics have been grasped, you can extend and provide more complexity. If you introduce the complexity early, you have to say "just do this, and ignore the reasons why", which leads to cargo-culting.

So - marking this ticket as someday/maybe, for the purposes of introducing a new tutorial step on template blocking.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as new
The owner will be changed from nobody to anonymous. Next status will be 'assigned'
as The resolution will be set. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.