Ticket #23: django-bigtable.diff
| File django-bigtable.diff, 1.2 KB (added by Simon Willison, 17 years ago) |
|---|
-
bigtable.py
18 18 import neo_cs 19 19 import neo_util 20 20 21 from django.template import Template as DjangoTemplate, Context as DjangoContext 22 21 23 table = [dict(a=1,b=2,c=3,d=4,e=5,f=6,g=7,h=8,i=9,j=10) 22 24 for x in range(1000)] 23 25 … … 45 47 <html xmlns:py="http://purl.org/kid/ns#">$table</html> 46 48 """) 47 49 50 django_tmpl = DjangoTemplate(""" 51 <table> 52 {% for row in table %} 53 <tr>{% for col in row.values %}{{ col }}{% endfor %}</tr> 54 {% endfor %} 55 </table> 56 """) 48 57 58 def test_django(): 59 """Djange template""" 60 context = DjangoContext({'table': table}) 61 django_tmpl.render(context) 62 49 63 def test_markup(): 50 64 """Markup template""" 51 65 ctxt = Context(table=table) … … 125 139 126 140 def run(which=None, number=10): 127 141 tests = ['test_builder', 'test_markup', 'test_markup_builder', 'test_kid', 128 'test_kid_et', 'test_et', 'test_cet', 'test_clearsilver'] 142 'test_kid_et', 'test_et', 'test_cet', 'test_clearsilver', 143 'test_django'] 129 144 if which: 130 145 tests = filter(lambda n: n[5:] in which, tests) 131 146
