Created
September 8, 2021 14:24
-
-
Save ciscoinfo/3153ae6dc945f76ea86f3a594aa7b545 to your computer and use it in GitHub Desktop.
article Flask (Python) : lire une requête PUT / POST - models 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Product: | |
id = 1 | |
def __init__(self, name, price, description="no description"): | |
self.id = Product.id | |
self.name = name | |
self.price = price | |
self.description = description | |
Product.id += 1 | |
def __repr__(self): | |
return f"<Product {self.id=}, {self.name=}, {self.description=}, {self.price=}>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment