Source code for tcms.rpc.api.classification

# Copyright (c) 2019-2021 Alexander Todorov <>

# Licensed under the GPL 2.0:

from modernrpc.core import rpc_method

from import Classification
from tcms.rpc.decorators import permissions_required

[docs]@permissions_required("management.view_classification") @rpc_method(name="Classification.filter") def filter(query): # pylint: disable=redefined-builtin """ .. function:: RPC Classification.filter(query) Perform a search and return the resulting list of classifications. :param query: Field lookups for :class:`` :type query: dict :return: Serialized list of :class:`` objects :rtype: dict """ return list(Classification.objects.filter(**query).values("id", "name").distinct())