Exemplo n.º 1
0
def filter(query={}):
    """
    .. function:: XML-RPC Build.filter(query)

        Search and return builds matching query.

        :param query: Field lookups for :class:`tcms.management.models.TestBuild`
        :type query: dict
        :return: List of serialized :class:`tcms.management.models.TestBuild` objects
        :rtype: list(dict)
    """
    return TestBuild.to_xmlrpc(query)
Exemplo n.º 2
0
def get_builds(request, product, is_active=True):
    """Get the list of builds associated with this product.

    :param product: product ID or name.
    :type product: int or str
    :param bool is_active: if ``True``, only return active builds. Otherwise,
        inactive builds will be returned.
    :return: a list of mappings of :class:`TestBuild`.
    :rtype: list

    Example::

        # Get with product id including all builds
        >>> Product.get_builds(1)
        # Get with product name excluding all inactive builds
        >>> Product.get_builds('product name', 0)
    """
    from tcms.management.models import TestBuild

    p = pre_check_product(values=product)
    query = {'product': p, 'is_active': parse_bool_value(is_active)}
    return TestBuild.to_xmlrpc(query)
Exemplo n.º 3
0
def get_builds(request, product, is_active=True):
    """
    Description: Get the list of builds associated with this product.

    Params:      $product  -  Integer/String
                              Integer: product_id of the product in the Database
                              String: Product name
                 $is_active - Boolean: True to only include builds where is_active is true.
                              Default: True
    Returns:     Array: Returns an array of Build objects.

    Example:
    # Get with product id including all builds
    >>> Product.get_builds(61)
    # Get with product name excluding all inactive builds
    >>> Product.get_builds('Red Hat Enterprise Linux 5', 0)
    """
    from tcms.management.models import TestBuild

    p = pre_check_product(values=product)
    query = {'product': p, 'is_active': parse_bool_value(is_active)}
    return TestBuild.to_xmlrpc(query)
Exemplo n.º 4
0
def get_builds(request, product, is_active=True):
    """
    Description: Get the list of builds associated with this product.

    Params:      $product  -  Integer/String
                              Integer: product_id of the product in the Database
                              String: Product name
                 $is_active - Boolean: True to only include builds where is_active is true.
                              Default: True
    Returns:     Array: Returns an array of Build objects.

    Example:
    # Get with product id including all builds
    >>> Product.get_builds(61)
    # Get with product name excluding all inactive builds
    >>> Product.get_builds('Red Hat Enterprise Linux 5', 0)
    """
    from tcms.management.models import TestBuild

    p = pre_check_product(values=product)
    query = {'product': p, 'is_active': parse_bool_value(is_active)}
    return TestBuild.to_xmlrpc(query)
Exemplo n.º 5
0
def get_builds(request, product, is_active=True):
    """Get the list of builds associated with this product.

    :param product: product ID or name.
    :type product: int or str
    :param bool is_active: if ``True``, only return active builds. Otherwise,
        inactive builds will be returned.
    :return: a list of mappings of :class:`TestBuild`.
    :rtype: list

    Example::

        # Get with product id including all builds
        >>> Product.get_builds(1)
        # Get with product name excluding all inactive builds
        >>> Product.get_builds('product name', 0)
    """
    from tcms.management.models import TestBuild

    p = pre_check_product(values=product)
    query = {'product': p, 'is_active': parse_bool_value(is_active)}
    return TestBuild.to_xmlrpc(query)