def timeline():
 result = Storage()
 inspection = []
 creation = []
 table = db.building_nzseel1
 dbresult = db((table.deleted == False)).select(table.date, table.estimated_damage, orderby=(~ table.date))
 inspection = getformatedData(dbresult)
 dbresult = db((table.deleted == False)).select(table.created_on, table.estimated_damage, orderby=(~ table.created_on))
 creation = getformatedData(dbresult)
 totals = [0, 0, 0, 0, 0, 0, 0, 0]
 for line in inspection:
  if (line[0][1] == 'Total'):
   for i in range(8):
    totals[i] += line[(i + 1)]
 return dict(inspection=inspection, creation=creation, totals=totals)

def timeline ( ) : result = Storage ( ) inspection = [ ] creation = [ ] table = db . building_nzseel1 dbresult = db ( ( table . deleted == False ) ) . select ( table . date , table . estimated_damage , orderby = ( ~ table . date ) ) inspection = getformatedData ( dbresult ) dbresult = db ( ( table . deleted == False ) ) . select ( table . created_on , table . estimated_damage , orderby = ( ~ table . created_on ) ) creation = getformatedData ( dbresult ) totals = [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ] for line in inspection : if ( line [ 0 ] [ 1 ] == 'Total' ) : for i in range ( 8 ) : totals [ i ] += line [ ( i + 1 ) ] return dict ( inspection = inspection , creation = creation , totals = totals )
shows a users timeline or if no user is logged in it will redirect to the public timeline .