示例#1
0
文件: product.py 项目: SebRut/pygrocy
 def get_details(self, api_client: GrocyApiClient):
     details = api_client.get_product(self.id)
     if details:
         self._name = details.product.name
         self._barcodes = [
             ProductBarcode(barcode) for barcode in details.barcodes
         ]
         self._product_group_id = details.product.product_group_id
         self._available_amount = details.stock_amount
示例#2
0
 def get_details(self, api_client: GrocyApiClient):
     details = api_client.get_product(self.id)
     if details:
         self._name = details.product.name
         self._barcodes = details.product.barcodes
         self._product_group_id = details.product.product_group_id
示例#3
0
 def get_details(self, api_client: GrocyApiClient):
     if self._product_id:
         self._product = Product(api_client.get_product(self._product_id))