Skip to content

Commit

Permalink
[rpc] Remove Product.get and Product.check_product. Refs #153
Browse files Browse the repository at this point in the history
replace these methods with Product.filter() method
  • Loading branch information
atodorov committed Jan 26, 2018
1 parent 9031d02 commit 2d27988
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions tcms/xmlrpc/api/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
__all__ = (
'check_category',
'check_component',
'check_product',
'filter',
'filter_categories',
'filter_components',
'filter_versions',
'get',
'get_builds',
'get_cases',
'get_categories',
Expand Down Expand Up @@ -79,27 +77,6 @@ def check_component(name, product):
return Component.objects.get(name=name, product=p).serialize()


@rpc_method(name='Product.check_product')
def check_product(name):
"""
Description: Looks up and returns a validated product.
Params: $name - Integer/String
Integer: product_id of the product in the Database
String: Product name
Returns: Hash: Matching Product object hash or error if not found.
Example:
# Get with product ID
>>> Product.check_product(61)
# Get with product name
>>> Product.check_product('Red Hat Enterprise Linux 5')
"""
p = pre_check_product(values=name)
return p.serialize()


@rpc_method(name='Product.filter')
def filter(query):
"""
Expand Down Expand Up @@ -219,21 +196,6 @@ def filter_versions(query):
return Version.to_xmlrpc(query)


@rpc_method(name='Product.get')
def get(id):
"""
Description: Used to load an existing product from the database.
Params: $id - An integer representing the ID in the database
Returns: A blessed TCMS Product object hash
Example:
>>> Product.get(61)
"""
return Product.objects.get(id=int(id)).serialize()


@rpc_method(name='Product.get_builds')
def get_builds(product, is_active=True):
"""
Expand Down

0 comments on commit 2d27988

Please sign in to comment.