Edgewall Software

Changes between Version 62 and Version 63 of GenshiTutorial


Ignore:
Timestamp:
Sep 1, 2007, 12:55:00 AM (12 years ago)
Author:
cmlenz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GenshiTutorial

    v62 v63  
    308308{{{
    309309#!genshi
     310<!DOCTYPE html>
    310311<html xmlns="http://www.w3.org/1999/xhtml"
    311312      xmlns:py="http://genshi.edgewall.org/">
     
    373374{{{
    374375#!genshi
     376<!DOCTYPE html>
    375377<html xmlns="http://www.w3.org/1999/xhtml"
    376378      xmlns:py="http://genshi.edgewall.org/">
     
    476478{{{
    477479#!genshi
     480<!DOCTYPE html>
    478481<html xmlns="http://www.w3.org/1999/xhtml"
    479482      xmlns:py="http://genshi.edgewall.org/">
     
    752755{{{
    753756#!genshi
     757<!DOCTYPE html>
    754758<html xmlns="http://www.w3.org/1999/xhtml"
    755759      xmlns:xi="http://www.w3.org/2001/XInclude"
     
    778782{{{
    779783#!genshi
     784<!DOCTYPE html>
    780785<html xmlns="http://www.w3.org/1999/xhtml"
    781786      xmlns:xi="http://www.w3.org/2001/XInclude"
     
    835840 * a form to add new comments.
    836841
    837 Note that on the model side we're covered, there's already a `Comment` class in `geddit.model`, and we even have two comments in our database already.
    838 
    839 So let's start by extending the `index.html` template to show how many comments there are so far, and make that a link to the detail page. Change your `geddit/templates/index.html` file to match the following:
     842Note that on the model side we're covered, there's already a `Comment` class in `geddit.model`, and we even have two comments in our database already. And we already have to form that'll be used to validate comment submissions, in form of the class `CommentForm` in `geddit.form`.
     843
     844So let's add the rest by extending the `index.html` template to show how many comments there are so far, and make that a link to the detail page. Change your `geddit/templates/index.html` file to match the following:
    840845
    841846{{{
     
    879884    @cherrypy.expose
    880885    @template.output('info.html')
    881     def info(self, code):
    882         link = self.data.get(code)
     886    def info(self, id):
     887        link = self.data.get(id)
    883888        if not link:
    884889            raise cherrypy.NotFound()