def req_item_packs():
    """
        Called by S3OptionsFilter to provide the pack options for an Item
    """

    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 v in "." 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()

# -----------------------------------------------------------------------------
dataset/ETHPy150Open sahana/eden/controllers/req.py/req_item_packs/swapped operands of `in`