Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #587 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

Missing line of code in docs/wiki20/page2.html

Reported by: Graham Higgins Owned by: anonymous
Priority: normal Milestone: 1.0b2
Component: Documentation Version:
Severity: normal Keywords:


Documentation refers to 6 lines of code but only five are presented, line number 5 (dealing with Unicode) is omitted.

Then, we'll replace the index method with one that:

   1. Sets the template to our newly named "page" (line 1)
   2. Has a default pagename of "FrontPage" (line 2)
   3. Retrieves the page from the database (line 3)
   4. Formats the text as HTML (line 4)
   5. Deals with unicode properly (always a good habit, on line 5)
   6. Returns the data for the template to use (line 6)

1	@turbogears.expose(html="wiki20.templates.page") 
2	def index(self, pagename="FrontPage"): 
3	    page = Page.byPagename(pagename) 
4	    content = publish_parts(page.data, writer_name="html")["html_body"] 
5	    return dict(data=content, pagename=page.pagename) 

All that in six, very readable lines.

Change History

comment:1 Changed 13 years ago by jorge.vargas

  • Milestone set to 1.0b1

needs to be fix in docs and newdocs

comment:2 Changed 13 years ago by khorn

  • Milestone changed from 1.0b1 to 1.0b2

milestoen passed, changing to 1.0b2

comment:3 Changed 13 years ago by elvelind

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

removed that line from the docs.

Note: See TracTickets for help on using tickets.