def track_movement():
 table = s3db.inv_track_item
 s3db.configure('inv_track_item', create=False, deletable=False, editable=False, listadd=False)
 def prep(r):
  if r.interactive:
   if ('viewing' in get_vars):
    (dummy, item_id) = get_vars.viewing.split('.')
    if (item_id != 'None'):
     query = ((table.send_inv_item_id == item_id) | (table.recv_inv_item_id == item_id))
     r.resource.add_filter(query)
  return True
 s3.prep = prep
 output = s3_rest_controller('inv', 'track_item', rheader=s3db.inv_rheader)
 if ('add_btn' in output):
  del output['add_btn']
 return output

def track_movement ( ) : table = s3db . inv_track_item s3db . configure ( 'inv_track_item' , create = False , deletable = False , editable = False , listadd = False ) def prep ( r ) : if r . interactive : if ( 'viewing' in get_vars ) : ( dummy , item_id ) = get_vars . viewing . split ( '.' ) if ( item_id != 'None' ) : query = ( ( table . send_inv_item_id == item_id ) | ( table . recv_inv_item_id == item_id ) ) r . resource . add_filter ( query ) return True s3 . prep = prep output = s3_rest_controller ( 'inv' , 'track_item' , rheader = s3db . inv_rheader ) if ( 'add_btn' in output ) : del output [ 'add_btn' ] return output
rest controller .