def inv_item_packs():
 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_id == ptable.item_id))
 records = db(query).select(ptable.id, ptable.name, ptable.quantity)
 output = records.json()
 response.headers['Content-Type'] = 'application/json'
 return output

def inv_item_packs ( ) : 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_id == ptable . item_id ) ) records = db ( query ) . select ( ptable . id , ptable . name , ptable . quantity ) output = records . json ( ) response . headers [ 'Content-Type' ] = 'application/json' return output
called by s3optionsfilter to provide the pack options for a particular item access via the .