Created
December 6, 2015 08:05
-
-
Save hkouns/e988675d78968b3dd8a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template = ''' | |
<html> | |
<head> | |
<style> | |
table, th, td { | |
border: 1px solid black; | |
} | |
th, td { | |
padding: 2px; | |
} | |
td { | |
border-style:dotted dotted dotted dotted; | |
} | |
</style> | |
</head> | |
<body> | |
<table width="1005"> | |
<tbody> | |
<tr> | |
<th width="50"> | |
<p> </p> | |
</th> | |
<th width="190"> | |
<p> </p> | |
</th> | |
<th width="150"> | |
<p> </p> | |
</th> | |
<th width="50"> | |
<p> </p> | |
</th> | |
<th width="110"> | |
<p align="center"><strong>Tithe</strong></p> | |
</th> | |
<th width="110"> | |
<p align="center"><strong>Bldg Fund</strong></p> | |
</th> | |
<th colspan="3" width="438"> | |
<p align="center"><strong>Other Funds </strong><em>(enter Fund Name)</em></p> | |
</th> | |
</tr> | |
<tr> | |
<th width="50"> | |
<p align="center"><strong>Id</strong></p> | |
</th> | |
<th width="190"> | |
<p><strong>Name</strong></p> | |
</th> | |
<th width="150"> | |
<p><strong>Spouse</strong></p> | |
</th> | |
<th width="50"> | |
<p align="center"><small>Type</small></p> | |
</th> | |
<th width="110"> | |
<p align="center"><strong>Amount</strong></p> | |
</th> | |
<th width="110"> | |
<p align="center"><strong>Amount</strong></p> | |
</th> | |
<th width="146"> | |
<p align="center"><strong>______________</strong></p> | |
</th> | |
<th width="146"> | |
<p align="center"><strong>______________</strong></p> | |
</th> | |
<th width="146"> | |
<p align="center"><strong>______________</strong></p> | |
</th> | |
</tr> | |
{{#each this}} | |
<tr> | |
<td width="50"> | |
<p align="center">{{PeopleId}}</p> | |
</td> | |
<td width="190"> | |
<p>{{Name2}}</p> | |
</td> | |
<td width="150"> | |
<p> | |
{{#IfEqual ContributionOptionsId 2}}{{Spouse}} <small>({{SpouseId}})</small>{{/IfEqual}} | |
</p> | |
</td> | |
<td width="50" > | |
<p align="center"><small> | |
{{#IfEqual ContributionOptionsId 1}}Ind.{{/IfEqual}} | |
{{#IfEqual ContributionOptionsId 2}}Joint{{/IfEqual}} | |
</small></p> | |
</td> | |
<td width="110"> | |
<p> </p> | |
</td> | |
<td width="110"> | |
<p> </p> | |
</td> | |
<td width="146"> | |
<p> </p> | |
</td> | |
<td width="146"> | |
<p> </p> | |
</td> | |
<td width="146"> | |
<p> </p> | |
</td> | |
</tr> | |
{{/each}} | |
</tbody> | |
</table> | |
</body> | |
</html> | |
''' | |
class SimpleClass(object): | |
pass | |
sqlpeople = q.QuerySqltoList('GivingUnits',"") | |
people=[] | |
for q in sqlpeople: | |
x = SimpleClass() | |
x.Name2 = q["Name2"] | |
x.PeopleId = q["PeopleId"] | |
x.Spouse = q["Spouse"] | |
x.SpouseId = q["SpouseId"] | |
x.ContributionOptionsId = q["ContributionOptionsId"] | |
people.append(x) | |
body = model.RenderTemplate(template, people) | |
print body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment