1
0
Fork 0
forked from s3lph/matemat

codestyle

This commit is contained in:
s3lph 2021-04-07 09:39:50 +02:00
parent ddcdc0f816
commit 85410e09e5
3 changed files with 5 additions and 3 deletions

View file

@ -380,7 +380,8 @@ class MatematDatabase(object):
product_id, name, price_member, price_non_member, custom_price, stock, stockable = row product_id, name, price_member, price_non_member, custom_price, stock, stockable = row
return Product(product_id, name, price_member, price_non_member, custom_price, stockable, stock) return Product(product_id, name, price_member, price_non_member, custom_price, stockable, stock)
def create_product(self, name: str, price_member: int, price_non_member: int, custom_price: bool, stockable: bool) -> Product: def create_product(self, name: str, price_member: int, price_non_member: int, custom_price:
bool, stockable: bool) -> Product:
""" """
Creates a new product. Creates a new product.
:param name: Name of the product. :param name: Name of the product.

View file

@ -36,4 +36,5 @@ class Product:
self.stockable == other.stockable self.stockable == other.stockable
def __hash__(self) -> int: def __hash__(self) -> int:
return hash((self.id, self.name, self.price_member, self.price_non_member, self.custom_price, self.stock, self.stockable)) return hash((self.id, self.name, self.price_member, self.price_non_member, self.custom_price,
self.stock, self.stockable))