Changes between Version 110 and Version 111 of GenshiTutorial
- Timestamp:
- Apr 16, 2008, 10:03:22 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GenshiTutorial
v110 v111 544 544 But there's a problem here: Note how the input values have vanished from the form! We'd have to repopulate the form manually from the data submitted so far. We could do that by adding the required `value=""` attributes to the text fields in the template, but Genshi provides a more elegant way: the [wiki:Documentation/filters.html#html-form-filler HTMLFormFiller] stream filter. Given a dictionary of values, it can automatically populate HTML forms in the template output stream. 545 545 546 To enable this functionality, first you'll need to add the following import to the `ge nshi/controller.py` file:546 To enable this functionality, first you'll need to add the following import to the `geddit/controller.py` file: 547 547 548 548 {{{ … … 624 624 }}} 625 625 626 In the `ge nshi/controller.py` file, you can now remove the `from genshi.template import TemplateLoader` line, and also the instantiation of the `TemplateLoader`, as that is now done in our new library module. Of course, you'll have to import that library module instead:626 In the `geddit/controller.py` file, you can now remove the `from genshi.template import TemplateLoader` line, and also the instantiation of the `TemplateLoader`, as that is now done in our new library module. Of course, you'll have to import that library module instead: 627 627 628 628 {{{