Fixing project template for validation changes

This commit is contained in:
Yoann Roman
2011-01-26 15:52:40 -05:00
parent 23794ab887
commit d6e20d6f20
2 changed files with 4 additions and 4 deletions

View File

@@ -11,7 +11,7 @@ class SampleForm(Schema):
class RootController(object):
@expose('index.html')
def index(self, name='', age=''):
return dict(errors=request.validation_error, name=name, age=age)
return dict(errors=request.validation_errors, name=name, age=age)
@expose('success.html', schema=SampleForm(), error_handler='index')
def handle_form(self, name, age):

View File

@@ -32,16 +32,16 @@
<tr>
<td><label for="name">What is your name</label></td>
<td><input name="name" value="${name}" class="${'invalid' if error_for('name') else ''}" /></td>
<td py:if="errors">${error_for('name')}</td>
<td>${error_for('name')}</td>
</tr>
<tr>
<td><label for="age">How old are you?</label></td>
<td><input name="age" value="${age}" class="${'invalid' if error_for('age') else ''}" /></td>
<td py:if="errors">${error_for('age')}</td>
<td>${error_for('age')}</td>
</tr>
</table>
<input type="submit" />
<input type="submit" value="Submit" />
</form>