def req_item_packs():
 req_item_id = None
 args = request.args
 if ((len(args) == 1) and args[0].isdigit()):
  req_item_id = args[0]
 else:
  for v in request.vars:
   if (('.' in v) and (v.split('.', 1)[1] == 'req_item_id')):
    req_item_id = request.vars[v]
    break
 table = s3db.supply_item_pack
 ritable = s3db.req_req_item
 query = ((ritable.id == req_item_id) & (ritable.item_id == table.item_id))
 response.headers['Content-Type'] = 'application/json'
 return db(query).select(table.id, table.name, table.quantity).json()

def req_item_packs ( ) : req_item_id = None args = request . args if ( ( len ( args ) == 1 ) and args [ 0 ] . isdigit ( ) ) : req_item_id = args [ 0 ] else : for v in request . vars : if ( ( '.' in v ) and ( v . split ( '.' , 1 ) [ 1 ] == 'req_item_id' ) ) : req_item_id = request . vars [ v ] break table = s3db . supply_item_pack ritable = s3db . req_req_item query = ( ( ritable . id == req_item_id ) & ( ritable . item_id == table . item_id ) ) response . headers [ 'Content-Type' ] = 'application/json' return db ( query ) . select ( table . id , table . name , table . quantity ) . json ( )
called by s3optionsfilter to provide the pack options for an item access via the .