def filter_components(request, query): """ Description: Performs a search and returns the resulting list of components. Params: $query - Hash: keys must match valid search fields. +------------------------------------------------------------------+ | Component Search Parameters | +------------------------------------------------------------------+ | Key | Valid Values | | id | Integer: ID of product | | name | String | | product | ForeignKey: Product | | initial_owner | ForeignKey: Auth.User | | initial_qa_contact | ForeignKey: Auth.User | | description | String | +------------------------------------------------------------------+ Returns: Array: Matching components are retuned in a list of hashes. Example: # Get all of components named like 'libvirt' >>> Product.filter_components({'name__icontains': 'libvirt'}) # Get all of components named in product 'Red Hat Enterprise Linux 5' >>> Product.filter_components({'product__name': 'Red Hat Enterprise Linux 5'}) """ from tcms.management.models import Component return Component.to_xmlrpc(query)
def filter_components(request, query): """Performs a search and returns the resulting list of components. :param dict query: a mapping containing following criteria. * id: (int) product ID. * name: (str) component name. * product: ForeignKey: :class:`Product`. * initial_owner: ForeignKey: ``Auth.User``. * initial_qa_contact: ForeignKey: ``Auth.User``. * description str: component description. :return: a mapping of found :class:`Component`. :rtype: dict Example:: # Get all of components named like 'libvirt' >>> Product.filter_components({'name__icontains': 'libvirt'}) # Get all of components named in product 'product name' >>> Product.filter_components({'product__name': 'product name'}) """ from tcms.management.models import Component return Component.to_xmlrpc(query)
def filter_components(request, query): """Performs a search and returns the resulting list of components. :param dict query: a mapping containing following criteria. * id: (int) product ID. * name: (str) component name. * product: ForeignKey: :class:`Product`. * initial_owner: ForeignKey: ``Auth.User``. * initial_qa_contact: ForeignKey: ``Auth.User``. * description str: component description. :return: a mapping of found :class:`Component`. :rtype: dict Example:: # Get all of components named like 'libvirt' >>> Product.filter_components({'name__icontains': 'libvirt'}) # Get all of components named in product 'product name' >>> Product.filter_components({'product__name': 'product name'}) """ from tcms.management.models import Component return Component.to_xmlrpc(query)
def filter_components(request, query): """ Description: Performs a search and returns the resulting list of components. Params: $query - Hash: keys must match valid search fields. +------------------------------------------------------------------+ | Component Search Parameters | +------------------------------------------------------------------+ | Key | Valid Values | | id | Integer: ID of product | | name | String | | product | ForeignKey: Product | | initial_owner | ForeignKey: Auth.User | | initial_qa_contact | ForeignKey: Auth.User | | description | String | +------------------------------------------------------------------+ Returns: Array: Matching components are retuned in a list of hashes. Example: # Get all of components named like 'libvirt' >>> Product.filter_components({'name__icontains': 'libvirt'}) # Get all of components named in product 'Red Hat Enterprise Linux 5' >>> Product.filter_components({'product__name': 'Red Hat Enterprise Linux 5'}) """ from tcms.management.models import Component return Component.to_xmlrpc(query)
def filter(query): # pylint: disable=redefined-builtin """ .. function:: XML-RPC Component.filter(query) Search and return the resulting list of components. :param query: Field lookups for :class:`tcms.management.models.Component` :type query: dict :return: List of serialized :class:`tcms.management.models.Component` objects :rtype: list(dict) """ return Component.to_xmlrpc(query)
def get_components(plan_id): """ Description: Get the list of components attached to this plan. Params: $plan_id - Integer/String: An integer representing the ID in the database Returns: Array: An array of component object hashes. Example: >>> TestPlan.get_components(12345) """ test_plan = TestPlan.objects.get(plan_id=plan_id) component_ids = test_plan.component.values_list('id', flat=True) query = {'id__in': component_ids} return Component.to_xmlrpc(query)
def get_components(request, plan_id): """Get the list of components attached to this plan. :param int plan_id: plan ID. :return: list of mappings of found :class:`Component`. :rtype: list[dict] Example:: TestPlan.get_components(1) """ tp = TestPlan.objects.get(plan_id=plan_id) component_ids = tp.component.values_list('id', flat=True) query = {'id__in': component_ids} return Component.to_xmlrpc(query)
def get_components(request, plan_id): """Get the list of components attached to this plan. :param int plan_id: plan ID. :return: list of mappings of found :class:`Component`. :rtype: list[dict] Example:: >>> TestPlan.get_components(1) """ tp = TestPlan.objects.get(plan_id=plan_id) component_ids = tp.component.values_list('id', flat=True) query = {'id__in': component_ids} return Component.to_xmlrpc(query)
def get_components(case_id): """ .. function:: XML-RPC TestCase.get_components(case_id) Get the list of components attached to this case. :param case_id: PK if TestCase :type case_id: int :return: Serialized list of :class:`tcms.management.models.Component` objects :rtype: list(dict) :raises: TestCase.DoesNotExist if missing test case matching PK """ test_case = TestCase.objects.get(case_id=case_id) component_ids = test_case.component.values_list('id', flat=True) query = {'id__in': component_ids} return Component.to_xmlrpc(query)
def get_components(case_id): """ Description: Get the list of components attached to this case. Params: $case_id - Integer/String: An integer representing the ID in the database Returns: Array: An array of component object hashes. Example: >>> TestCase.get_components(12345) """ from tcms.management.models import Component test_case = TestCase.objects.get(case_id=case_id) component_ids = test_case.component.values_list('id', flat=True) query = {'id__in': component_ids} return Component.to_xmlrpc(query)
def get_components(request, plan_id): """ Description: Get the list of components attached to this plan. Params: $plan_id - Integer/String: An integer representing the ID in the database Returns: Array: An array of component object hashes. Example: >>> TestPlan.get_components(12345) """ try: tp = TestPlan.objects.get(plan_id=plan_id) except: raise component_ids = tp.component.values_list('id', flat=True) query = {'id__in': component_ids} return Component.to_xmlrpc(query)
def get_components(request, case_id): """Get the list of components attached to this case. :param case_id: case ID. :type case_id: int or str :return: a list of mappings of :class:`Component`. :rtype: list[dict] Example:: >>> TestCase.get_components(1) """ from tcms.management.models import Component tc = TestCase.objects.get(case_id=case_id) component_ids = tc.component.values_list('id', flat=True) query = {'id__in': component_ids} return Component.to_xmlrpc(query)
def get_components(request, case_id): """Get the list of components attached to this case. :param case_id: case ID. :type case_id: int or str :return: a list of mappings of :class:`Component`. :rtype: list[dict] Example:: TestCase.get_components(1) """ from tcms.management.models import Component tc = TestCase.objects.get(case_id=case_id) component_ids = tc.component.values_list('id', flat=True) query = {'id__in': component_ids} return Component.to_xmlrpc(query)
def get_components(request, product): """Get the list of components associated with this product. :param product: product ID or name. :type product: int or str :return: a list of mappings of :class:`Component`. :rtype: list Example:: # Get with product id >>> Product.get_components(61) # Get with product name >>> Product.get_components('product name') """ from tcms.management.models import Component p = pre_check_product(values=product) query = {'product': p} return Component.to_xmlrpc(query)
def get_components(request, product): """Get the list of components associated with this product. :param product: product ID or name. :type product: int or str :return: a list of mappings of :class:`Component`. :rtype: list Example:: # Get with product id >>> Product.get_components(61) # Get with product name >>> Product.get_components('product name') """ from tcms.management.models import Component p = pre_check_product(values=product) query = {'product': p} return Component.to_xmlrpc(query)
def get_components(request, case_id): """" Description: Get the list of components attached to this case. Params: $case_id - Integer/String: An integer representing the ID in the database Returns: Array: An array of component object hashes. Example: >>> TestCase.get_components(12345) """ from tcms.management.models import Component try: tc = TestCase.objects.get(case_id=case_id) except: raise component_ids = tc.component.values_list('id', flat=True) query = {'id__in': component_ids} return Component.to_xmlrpc(query)
def get_components(request, product): """ Description: Get the list of components associated with this product. Params: $product - Integer/String Integer: product_id of the product in the Database String: Product name Returns: Array: Returns an array of Component objects. Example: # Get with product id >>> Product.get_components(61) # Get with product name >>> Product.get_components('Red Hat Enterprise Linux 5') """ from tcms.management.models import Component p = pre_check_product(values=product) query = {'product': p} return Component.to_xmlrpc(query)
def get_components(request, product): """ Description: Get the list of components associated with this product. Params: $product - Integer/String Integer: product_id of the product in the Database String: Product name Returns: Array: Returns an array of Component objects. Example: # Get with product id >>> Product.get_components(61) # Get with product name >>> Product.get_components('Red Hat Enterprise Linux 5') """ from tcms.management.models import Component p = pre_check_product(values=product) query = {'product': p} return Component.to_xmlrpc(query)