You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/05_flask_smorest/02_data_model_improvements/README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -245,6 +245,8 @@ def create_store():
245
245
<TabItemvalue="new"label="create_store (new)">
246
246
247
247
```py title="app.py"
248
+
import uuid
249
+
248
250
@app.post("/store")
249
251
defcreate_store():
250
252
store_data = request.get_json()
@@ -255,6 +257,8 @@ def create_store():
255
257
return store
256
258
```
257
259
260
+
Here we add a new import, [the `uuid` module](https://docs.python.org/3/library/uuid.html). We will be using it to create unique IDs for our stores and items instead of relying on the uniqueness of their `names`.
0 commit comments