Skip to content

Instantly share code, notes, and snippets.

@gkocjan gkocjan/ Secret
Last active Sep 26, 2019

What would you like to do?
from dataclasses import dataclass, field
from datetime import datetime
from typing import List
class Client(BaseEntity):
id: int
name: str
class Product(BaseEntity):
id: int
name: str
price: float
class Order(BaseEntity):
id: int
created: datetime
client: Client
total_cost: float = 0
items: List[Product] = field(default_factory=list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.