Added selling_price command

doc_update
Joey Hines 2019-02-16 15:58:58 -06:00
parent b88bfbda43
commit 2513661003
1 changed files with 22 additions and 3 deletions

View File

@ -291,16 +291,35 @@ def add_item(item_name, quantity, diamond_price, shop_name=None, discord_uuid=No
@command("GET") @command("GET")
def selling(item_name, sort="-date_restocked"): def selling(item_name):
''' '''
:request: GET :request: GET
:param item_name: Item name to search for :param item_name: Item name to search for
:param sort: Field to sort shop results by, default is date_restocked :param sort: Field to sort shop results by, default is date_restocked
:return: List of top matching shops, sorted by the :return: List of top matching shops, sorted by the
:raises: ItemNotFound :raises: ItemNotFound
:help: Lists shops selling an item. :help: Lists shops selling an item. Sorted by when they were last restocked.
''' '''
return get_selling(item_name, sort="-date_restocked")
@command("GET")
def selling(item_name):
'''
:request: GET
:param item_name: Item name to search for
:param sort: Field to sort shop results by, default is date_restocked
:return: List of top matching shops, sorted by the
:raises: ItemNotFound
:help: Lists shops selling an item. Sorted lowest price to highest price.
'''
return get_selling(item_name, sort="-normalized_price")
def get_selling(item_name, sort="-date_restocked"):
items = [] items = []
if len(item_name) == 0: if len(item_name) == 0:
raise EmptryString raise EmptryString
@ -600,7 +619,7 @@ def remove_resident(resident_name, town_name, discord_uuid=None, mc_uuid=None):
:param town_name: Name of the town, can be blank if the owner has one town :param town_name: Name of the town, can be blank if the owner has one town
:param discord_uuid: Owner discord uuid :param discord_uuid: Owner discord uuid
:param mc_uuid: Owner mc uuid :param mc_uuid: Owner mc uuid
:raises: PlayerNotFound, LocationLookupError, IsResidentError, ResidentNotFoundError :raises: PlayerNotFound, LocationLookupError, ResidentNotFoundError
:return: Updated town :return: Updated town
:help: Removes a resident from a town :help: Removes a resident from a town
''' '''