Python: Add TurboGears templating example

This commit is contained in:
Rasmus Wriedt Larsen
2019-11-27 15:07:32 +01:00
parent b526421072
commit 44cc9dd0be
3 changed files with 6 additions and 0 deletions

View File

@@ -2,3 +2,4 @@
| test.py:13:5:13:50 | Function ok_validated |
| test.py:18:5:18:57 | Function partially_validated |
| test.py:22:5:22:51 | Function not_validated |
| test.py:26:5:26:28 | Function with_template |

View File

@@ -2,3 +2,4 @@
| test.py:14 | BinaryExpr | externally controlled string |
| test.py:19 | BinaryExpr | externally controlled string |
| test.py:23 | BinaryExpr | externally controlled string |
| test.py:27 | Dict | {externally controlled string} |

View File

@@ -21,3 +21,7 @@ class RootController(TGController):
@expose()
def not_validated(self, a=None, b=None, *args):
return 'Values: %s, %s, %s' % (a, b, args)
@expose("<template_path>")
def with_template(self):
return {'template_var': 'foo'}