We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
tutorial002
tax=0
1 parent 0541693 commit 9667ce8Copy full SHA for 9667ce8
2 files changed
docs_src/body/tutorial002.py
@@ -17,7 +17,7 @@ class Item(BaseModel):
17
@app.post("/items/")
18
async def create_item(item: Item):
19
item_dict = item.dict()
20
- if item.tax:
+ if item.tax is not None:
21
price_with_tax = item.price + item.tax
22
item_dict.update({"price_with_tax": price_with_tax})
23
return item_dict
docs_src/body/tutorial002_py310.py
@@ -15,7 +15,7 @@ class Item(BaseModel):
15
16
0 commit comments