Changes between Version 62 and Version 63 of GenshiTutorial
- Timestamp:
- Sep 1, 2007, 12:55:00 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GenshiTutorial
v62 v63 308 308 {{{ 309 309 #!genshi 310 <!DOCTYPE html> 310 311 <html xmlns="http://www.w3.org/1999/xhtml" 311 312 xmlns:py="http://genshi.edgewall.org/"> … … 373 374 {{{ 374 375 #!genshi 376 <!DOCTYPE html> 375 377 <html xmlns="http://www.w3.org/1999/xhtml" 376 378 xmlns:py="http://genshi.edgewall.org/"> … … 476 478 {{{ 477 479 #!genshi 480 <!DOCTYPE html> 478 481 <html xmlns="http://www.w3.org/1999/xhtml" 479 482 xmlns:py="http://genshi.edgewall.org/"> … … 752 755 {{{ 753 756 #!genshi 757 <!DOCTYPE html> 754 758 <html xmlns="http://www.w3.org/1999/xhtml" 755 759 xmlns:xi="http://www.w3.org/2001/XInclude" … … 778 782 {{{ 779 783 #!genshi 784 <!DOCTYPE html> 780 785 <html xmlns="http://www.w3.org/1999/xhtml" 781 786 xmlns:xi="http://www.w3.org/2001/XInclude" … … 835 840 * a form to add new comments. 836 841 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:842 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. And we already have to form that'll be used to validate comment submissions, in form of the class `CommentForm` in `geddit.form`. 843 844 So 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: 840 845 841 846 {{{ … … 879 884 @cherrypy.expose 880 885 @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) 883 888 if not link: 884 889 raise cherrypy.NotFound()