mirror of
https://github.com/almet/copanier.git
synced 2025-04-28 19:42:37 +02:00
Cleaner default factories
This commit is contained in:
parent
8324136533
commit
3d4aec6deb
1 changed files with 3 additions and 3 deletions
|
@ -113,7 +113,7 @@ class ProductOrder(Base):
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Order(Base):
|
class Order(Base):
|
||||||
products: Dict[str, ProductOrder] = field(default_factory=lambda *a, **k: {})
|
products: Dict[str, ProductOrder] = field(default_factory=dict)
|
||||||
paid: bool = False
|
paid: bool = False
|
||||||
|
|
||||||
def get_quantity(self, product):
|
def get_quantity(self, product):
|
||||||
|
@ -140,8 +140,8 @@ class Delivery(Base):
|
||||||
description: str = ""
|
description: str = ""
|
||||||
instructions: str = ""
|
instructions: str = ""
|
||||||
where: str = "Marché de la Briche"
|
where: str = "Marché de la Briche"
|
||||||
products: List[Product] = field(default_factory=lambda *a, **k: [])
|
products: List[Product] = field(default_factory=list)
|
||||||
orders: Dict[str, Order] = field(default_factory=lambda *a, **k: {})
|
orders: Dict[str, Order] = field(default_factory=dict)
|
||||||
id: str = field(default_factory=lambda *a, **k: uuid.uuid4().hex)
|
id: str = field(default_factory=lambda *a, **k: uuid.uuid4().hex)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Reference in a new issue