Esempio n. 1
0
 def post( self ):
         name = self.request.get( 'name' )
         if name == 'My Shakes':
             name = Session()['username']
             user = User.all().filter( 'email =', db.Email( name ) ).fetch( 1 )[0]
             date = getDateObject( self.request.get( 'date' ) , 0 )
             event = ShakeEvent.all().filter( 'user ='******'startDate =', date ).fetch( 1 )[0]
         else:
             date = getDateObject( self.request.get( 'date' ), 0 )
             event = ShakeEvent.all().filter( 'startDate =', date ).fetch( 1 )[0]
         ( x_list, y_list, z_list ) = self.fetchDataAndResample( event )
         params = {'x':x_list, 'y':y_list, 'z':z_list, 'label':'Your Data'}
         logging.error( params )
         self.response.out.write( jsoncreator.to_string( params ) )
Esempio n. 2
0
 def get( self ):
     events = ShakeEvent.all().fetch( 10 );
     strlist = [];
     for event in events:
         strlist.append( jsoncreator.to_string( jsoncreator.to_dict( event ) ) )
     doRender( self, 'shakemap.htm', {'output':strlist} )