Skip to content

Instantly share code, notes, and snippets.

@ciscoinfo
Created September 8, 2021 14:24
Show Gist options
  • Save ciscoinfo/3153ae6dc945f76ea86f3a594aa7b545 to your computer and use it in GitHub Desktop.
Save ciscoinfo/3153ae6dc945f76ea86f3a594aa7b545 to your computer and use it in GitHub Desktop.
article Flask (Python) : lire une requête PUT / POST - models 2
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