def inv_item_quantity():
 try:
  item_id = request.args[0]
 except:
  raise HTTP(400, current.xml.json_message(False, 400, 'No value provided!'))
 table = s3db.inv_inv_item
 ptable = db.supply_item_pack
 query = ((table.id == item_id) & (table.item_pack_id == ptable.id))
 record = db(query).select(table.quantity, ptable.quantity, limitby=(0, 1)).first()
 d = {'iquantity': record.inv_inv_item.quantity, 'pquantity': record.supply_item_pack.quantity}
 output = json.dumps(d)
 response.headers['Content-Type'] = 'application/json'
 return output

def inv_item_quantity ( ) : try : item_id = request . args [ 0 ] except : raise HTTP ( 400 , current . xml . json_message ( False , 400 , 'No value provided!' ) ) table = s3db . inv_inv_item ptable = db . supply_item_pack query = ( ( table . id == item_id ) & ( table . item_pack_id == ptable . id ) ) record = db ( query ) . select ( table . quantity , ptable . quantity , limitby = ( 0 , 1 ) ) . first ( ) d = { 'iquantity' : record . inv_inv_item . quantity , 'pquantity' : record . supply_item_pack . quantity } output = json . dumps ( d ) response . headers [ 'Content-Type' ] = 'application/json' return output
access via the .