#NEWLINE# @ tornado . web . asynchronous #NEWLINE# def post( self ) : #NEWLINE# #INDENT# if ( not self . current_user ) : #NEWLINE# #INDENT# return self . send_error ( 403 ) #NEWLINE# #UNINDENT# self . pushid = pushmanager . core . util . get_int_arg ( self . request , 'push' ) #NEWLINE# self . requestid = self . request . arguments . get ( 'request' , [ ] ) #NEWLINE# select_query = db . push_requests . select ( ) . where ( db . push_requests . c . id . in_ ( self . requestid ) ) #NEWLINE# update_query = db . push_requests . update ( ) . where ( SA . and_ ( db . push_requests . c . id . in_ ( self . requestid ) , SA . exists ( [ 1 ] , SA . and_ ( ( db . push_pushcontents . c . push == self . pushid ) , ( db . push_pushcontents . c . request == db . push_requests . c . id ) ) ) ) ) . values ( { #NEWLINE# #INDENT# 'state' : 'requested' , #NEWLINE# #UNINDENT# } ) #NEWLINE# delete_query = db . push_pushcontents . delete ( SA . and_ ( ( db . push_pushcontents . c . push == self . pushid ) , db . push_pushcontents . c . request . in_ ( self . requestid ) ) ) #NEWLINE# db . execute_transaction_cb ( [ select_query , update_query , delete_query ] , self . on_db_complete )