comparison examples/tutorial/geddit/controller.py @ 616:80a9c247ca80

GenshiTutorial: use form filler on comment/reply views.
author cmlenz
date Wed, 29 Aug 2007 20:51:39 +0000
parents 0dc152d128f5
children 5a2059ce1f0b
comparison
equal deleted inserted replaced
615:0dc152d128f5 616:80a9c247ca80
81 errors = e.unpack_errors() 81 errors = e.unpack_errors()
82 else: 82 else:
83 errors = {} 83 errors = {}
84 84
85 return template.render(submission=submission, comment=None, 85 return template.render(submission=submission, comment=None,
86 errors=errors) 86 errors=errors) | HTMLFormFiller(data=data)
87 87
88 @cherrypy.expose 88 @cherrypy.expose
89 @template.output('comment.html') 89 @template.output('comment.html')
90 def reply(self, code, cancel=False, **data): 90 def reply(self, code, cancel=False, **data):
91 comment = self._comment_lookup.get(code) 91 comment = self._comment_lookup.get(code)
105 errors = e.unpack_errors() 105 errors = e.unpack_errors()
106 else: 106 else:
107 errors = {} 107 errors = {}
108 108
109 return template.render(submission=submission, comment=comment, 109 return template.render(submission=submission, comment=comment,
110 errors=errors) 110 errors=errors) | HTMLFormFiller(data=data)
111 111
112 112
113 def main(filename): 113 def main(filename):
114 # load data from the pickle file, or initialize it to an empty list 114 # load data from the pickle file, or initialize it to an empty list
115 if os.path.exists(filename): 115 if os.path.exists(filename):
Copyright (C) 2012-2017 Edgewall Software