Ejemplo n.º 1
0
def table(slug):
    try:
        table = Table.get('tables', slug)
    except TableDoesNotExist:
        abort(404)
    
    return render_template('table.html', table=table)
Ejemplo n.º 2
0
 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)
Ejemplo n.º 3
0
 def testGetTable(self):
     t = Table.get(self.table_path, 'example')
     self.assertEqual(t.title, 'Failed Banks List')
Ejemplo n.º 4
0
def index():
    tables = Table.all('tables')
    return render_template('index.html', tables=tables)