Last active
April 17, 2017 20:44
-
-
Save vabarbosa/b0834fa945fea8a1c9265ddbee81c97a to your computer and use it in GitHub Desktop.
PixieDust Extensibility API - Simple Table Template
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
from pixiedust.display.display import * | |
class TestDisplay(Display): | |
def doRender(self, handlerId): | |
self._addHTMLTemplateString( | |
""" | |
<div>My Simple Table</div> | |
<table class="table table-striped"> | |
<thead> | |
{%for field in entity.schema.fields%} | |
<th>{{field.name}}</th> | |
{%endfor%} | |
</thead> | |
<tbody> | |
{%for row in entity.take(100)%} | |
<tr> | |
{%for field in entity.schema.fields%} | |
<td>{{row[field.name]}}</td> | |
{%endfor%} | |
</tr> | |
{%endfor%} | |
</tbody> | |
</table> | |
""" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment