def table(slug): try: table = Table.get('tables', slug) except TableDoesNotExist: abort(404) return render_template('table.html', table=table)
def testTableIndex(self): all = Table.all(self.table_path) results = { 'example': 'Failed Banks List', 'example_faceted': 'Appropriations by District', 'example_formatted': 'Stimulus Progress', 'example_local': 'Browse All Approved Stimulus Highway Projects' } self.assertEqual(type(all), dict) for slug, title in results.items(): self.assertEqual(title, all[slug].title)
def testGetTable(self): t = Table.get(self.table_path, 'example') self.assertEqual(t.title, 'Failed Banks List')
def index(): tables = Table.all('tables') return render_template('index.html', tables=tables)