Example #1
0
def filter(query):
    """
    Description: Performs a search and returns the resulting list of products.

    Params:      $query - Hash: keys must match valid search fields.

TODO: query keys match the product class

    +------------------------------------------------------------------+
    |               Product Search Parameters                          |
    +------------------------------------------------------------------+
    |        Key          |          Valid Values                      |
    | id                  | Integer: ID of product                     |
    | name                | String                                     |
    | classification      | ForeignKey: Classfication                  |
    | description         | String                                     |
    +------------------------------------------------------------------+

    Returns:     Array: Matching products are retuned in a list of hashes.

    Example:
    # Get all of product named 'Red Hat Enterprise Linux 5'
    >>> Product.filter({'name': 'Red Hat Enterprise Linux 5'})
    """
    return Product.to_xmlrpc(query)
Example #2
0
def filter(query):  # pylint: disable=redefined-builtin
    """
    .. function:: XML-RPC Product.filter(query)

        Perform a search and return the resulting list of products.

        :param query: Field lookups for :class:`tcms.management.models.Product`
        :type query: dict
        :return: Serialized list of :class:`tcms.management.models.Product` objects
        :rtype: dict

    Example::

        # Get all of products named 'Red Hat Enterprise Linux 5'
        >>> Product.filter({'name': 'Red Hat Enterprise Linux 5'})
    """
    return Product.to_xmlrpc(query)
Example #3
0
def filter(request, query):
    """Performs a search and returns the resulting list of products.

    :param dict query: a mapping containing following criteria.

        * id: (int) product id.
        * name: (str) product name.
        * classification: ForeignKey: :class:`Classification`.
        * description: (str) description.

    :return: a mapping representing a :class:`Product`.
    :rtype: dict

    Example::

        # Get all of product named 'product name'
        >>> Product.filter({'name': 'product name'})
    """
    return Product.to_xmlrpc(query)
Example #4
0
def filter(request, query):
    """Performs a search and returns the resulting list of products.

    :param dict query: a mapping containing following criteria.

        * id: (int) product id.
        * name: (str) product name.
        * classification: ForeignKey: :class:`Classification`.
        * description: (str) description.

    :return: a mapping representing a :class:`Product`.
    :rtype: dict

    Example::

        # Get all of product named 'product name'
        >>> Product.filter({'name': 'product name'})
    """
    return Product.to_xmlrpc(query)
Example #5
0
def filter(request, query):
    """
    Description: Performs a search and returns the resulting list of products.

    Params:      $query - Hash: keys must match valid search fields.

    +------------------------------------------------------------------+
    |               Product Search Parameters                          |
    +------------------------------------------------------------------+
    |        Key          |          Valid Values                      |
    | id                  | Integer: ID of product                     |
    | name                | String                                     |
    | classification      | ForeignKey: Classfication                  |
    | description         | String                                     |
    +------------------------------------------------------------------+

    Returns:     Array: Matching products are retuned in a list of hashes.

    Example:
    # Get all of product named 'Red Hat Enterprise Linux 5'
    >>> Product.filter({'name': 'Red Hat Enterprise Linux 5'})
    """
    return Product.to_xmlrpc(query)