mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-02 20:15:24 +02:00
feat: Upgrade to Pydantic V2 (#3134)
Some checks are pending
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Docker Nightly Production / Build Tagged Release (push) Blocked by required conditions
Docker Nightly Production / Notify Discord (push) Blocked by required conditions
Docker Nightly Production / Backend Server Tests (push) Waiting to run
Docker Nightly Production / Frontend and End-to-End Tests (push) Waiting to run
Some checks are pending
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Docker Nightly Production / Build Tagged Release (push) Blocked by required conditions
Docker Nightly Production / Notify Discord (push) Blocked by required conditions
Docker Nightly Production / Backend Server Tests (push) Waiting to run
Docker Nightly Production / Frontend and End-to-End Tests (push) Waiting to run
* bumped pydantic
This commit is contained in:
parent
248459671e
commit
7a107584c7
129 changed files with 1138 additions and 833 deletions
|
@ -41,7 +41,7 @@ def cookbooks(database: AllRepositories, unique_user: TestUser) -> list[TestCook
|
|||
for _ in range(3):
|
||||
cb = database.cookbooks.create(SaveCookBook(**get_page_data(unique_user.group_id)))
|
||||
data.append(cb)
|
||||
yield_data.append(TestCookbook(id=cb.id, slug=cb.slug, name=cb.name, data=cb.dict()))
|
||||
yield_data.append(TestCookbook(id=cb.id, slug=cb.slug, name=cb.name, data=cb.model_dump()))
|
||||
|
||||
yield yield_data
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ def register_user(api_client, invite):
|
|||
registration.group = ""
|
||||
registration.group_token = invite
|
||||
|
||||
response = api_client.post(api_routes.users_register, json=registration.dict(by_alias=True))
|
||||
response = api_client.post(api_routes.users_register, json=registration.model_dump(by_alias=True))
|
||||
return registration, response
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ def route_all_slice(page: int, perPage: int, start_date: str, end_date: str):
|
|||
def test_create_mealplan_no_recipe(api_client: TestClient, unique_user: TestUser):
|
||||
title = random_string(length=25)
|
||||
text = random_string(length=25)
|
||||
new_plan = CreatePlanEntry(date=date.today(), entry_type="breakfast", title=title, text=text).dict()
|
||||
new_plan = CreatePlanEntry(date=date.today(), entry_type="breakfast", title=title, text=text).model_dump()
|
||||
new_plan["date"] = date.today().strftime("%Y-%m-%d")
|
||||
|
||||
response = api_client.post(api_routes.groups_mealplans, json=new_plan, headers=unique_user.token)
|
||||
|
@ -36,7 +36,7 @@ def test_create_mealplan_with_recipe(api_client: TestClient, unique_user: TestUs
|
|||
recipe = response.json()
|
||||
recipe_id = recipe["id"]
|
||||
|
||||
new_plan = CreatePlanEntry(date=date.today(), entry_type="dinner", recipe_id=recipe_id).dict(by_alias=True)
|
||||
new_plan = CreatePlanEntry(date=date.today(), entry_type="dinner", recipe_id=recipe_id).model_dump(by_alias=True)
|
||||
new_plan["date"] = date.today().strftime("%Y-%m-%d")
|
||||
new_plan["recipeId"] = str(recipe_id)
|
||||
|
||||
|
@ -53,7 +53,7 @@ def test_crud_mealplan(api_client: TestClient, unique_user: TestUser):
|
|||
entry_type="breakfast",
|
||||
title=random_string(),
|
||||
text=random_string(),
|
||||
).dict()
|
||||
).model_dump()
|
||||
|
||||
# Create
|
||||
new_plan["date"] = date.today().strftime("%Y-%m-%d")
|
||||
|
@ -91,7 +91,7 @@ def test_get_all_mealplans(api_client: TestClient, unique_user: TestUser):
|
|||
entry_type="breakfast",
|
||||
title=random_string(),
|
||||
text=random_string(),
|
||||
).dict()
|
||||
).model_dump()
|
||||
|
||||
new_plan["date"] = date.today().strftime("%Y-%m-%d")
|
||||
response = api_client.post(api_routes.groups_mealplans, json=new_plan, headers=unique_user.token)
|
||||
|
@ -109,7 +109,7 @@ def test_get_slice_mealplans(api_client: TestClient, unique_user: TestUser):
|
|||
|
||||
# Make a list of 10 meal plans
|
||||
meal_plans = [
|
||||
CreatePlanEntry(date=date, entry_type="breakfast", title=random_string(), text=random_string()).dict()
|
||||
CreatePlanEntry(date=date, entry_type="breakfast", title=random_string(), text=random_string()).model_dump()
|
||||
for date in dates
|
||||
]
|
||||
|
||||
|
@ -138,7 +138,9 @@ def test_get_slice_mealplans(api_client: TestClient, unique_user: TestUser):
|
|||
def test_get_mealplan_today(api_client: TestClient, unique_user: TestUser):
|
||||
# Create Meal Plans for today
|
||||
test_meal_plans = [
|
||||
CreatePlanEntry(date=date.today(), entry_type="breakfast", title=random_string(), text=random_string()).dict()
|
||||
CreatePlanEntry(
|
||||
date=date.today(), entry_type="breakfast", title=random_string(), text=random_string()
|
||||
).model_dump()
|
||||
for _ in range(3)
|
||||
]
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ def test_group_mealplan_rules_create(
|
|||
"groupId": unique_user.group_id,
|
||||
"day": "monday",
|
||||
"entryType": "breakfast",
|
||||
"categories": [category.dict()],
|
||||
"categories": [category.model_dump()],
|
||||
}
|
||||
|
||||
response = api_client.post(
|
||||
|
|
|
@ -38,14 +38,14 @@ def preferences_generator():
|
|||
category_created=random_bool(),
|
||||
category_updated=random_bool(),
|
||||
category_deleted=random_bool(),
|
||||
).dict(by_alias=True)
|
||||
).model_dump(by_alias=True)
|
||||
|
||||
|
||||
def notifier_generator():
|
||||
return GroupEventNotifierCreate(
|
||||
name=random_string(),
|
||||
apprise_url=random_string(),
|
||||
).dict(by_alias=True)
|
||||
).model_dump(by_alias=True)
|
||||
|
||||
|
||||
def event_generator():
|
||||
|
|
|
@ -33,7 +33,7 @@ def test_preferences_in_group(api_client: TestClient, unique_user: TestUser) ->
|
|||
def test_update_preferences(api_client: TestClient, unique_user: TestUser) -> None:
|
||||
new_data = UpdateGroupPreferences(recipe_public=False, recipe_show_nutrition=True)
|
||||
|
||||
response = api_client.put(api_routes.groups_preferences, json=new_data.dict(), headers=unique_user.token)
|
||||
response = api_client.put(api_routes.groups_preferences, json=new_data.model_dump(), headers=unique_user.token)
|
||||
|
||||
assert response.status_code == 200
|
||||
|
||||
|
@ -43,4 +43,4 @@ def test_update_preferences(api_client: TestClient, unique_user: TestUser) -> No
|
|||
assert preferences["recipePublic"] is False
|
||||
assert preferences["recipeShowNutrition"] is True
|
||||
|
||||
assert_ignore_keys(new_data.dict(by_alias=True), preferences, ["id", "groupId"])
|
||||
assert_ignore_keys(new_data.model_dump(by_alias=True), preferences, ["id", "groupId"])
|
||||
|
|
|
@ -7,7 +7,7 @@ from tests.utils.factories import user_registration_factory
|
|||
def test_user_registration_new_group(api_client: TestClient):
|
||||
registration = user_registration_factory()
|
||||
|
||||
response = api_client.post(api_routes.users_register, json=registration.dict(by_alias=True))
|
||||
response = api_client.post(api_routes.users_register, json=registration.model_dump(by_alias=True))
|
||||
assert response.status_code == 201
|
||||
|
||||
# Login
|
||||
|
@ -23,7 +23,7 @@ def test_user_registration_new_group(api_client: TestClient):
|
|||
def test_new_user_group_permissions(api_client: TestClient):
|
||||
registration = user_registration_factory()
|
||||
|
||||
response = api_client.post(api_routes.users_register, json=registration.dict(by_alias=True))
|
||||
response = api_client.post(api_routes.users_register, json=registration.model_dump(by_alias=True))
|
||||
assert response.status_code == 201
|
||||
|
||||
# Login
|
||||
|
|
|
@ -23,7 +23,7 @@ def create_item(list_id: UUID4) -> dict:
|
|||
def serialize_list_items(list_items: list[ShoppingListItemOut]) -> list:
|
||||
as_dict = []
|
||||
for item in list_items:
|
||||
item_dict = item.dict(by_alias=True)
|
||||
item_dict = item.model_dump(by_alias=True)
|
||||
item_dict["shoppingListId"] = str(item.shopping_list_id)
|
||||
item_dict["id"] = str(item.id)
|
||||
as_dict.append(item_dict)
|
||||
|
@ -192,7 +192,7 @@ def test_shopping_list_items_update_many_reorder(
|
|||
as_dict = []
|
||||
for i, item in enumerate(list_items):
|
||||
item.position = i
|
||||
item_dict = item.dict(by_alias=True)
|
||||
item_dict = item.model_dump(by_alias=True)
|
||||
item_dict["shoppingListId"] = str(list_with_items.id)
|
||||
item_dict["id"] = str(item.id)
|
||||
as_dict.append(item_dict)
|
||||
|
@ -319,7 +319,7 @@ def test_shopping_list_items_update_mergable(
|
|||
|
||||
item.note = list_with_items.list_items[i - 1].note
|
||||
|
||||
payload = utils.jsonify([item.dict() for item in list_with_items.list_items])
|
||||
payload = utils.jsonify([item.model_dump() for item in list_with_items.list_items])
|
||||
response = api_client.put(api_routes.groups_shopping_items, json=payload, headers=unique_user.token)
|
||||
as_json = utils.assert_derserialize(response, 200)
|
||||
|
||||
|
@ -382,7 +382,7 @@ def test_shopping_list_items_checked_off(
|
|||
|
||||
response = api_client.put(
|
||||
api_routes.groups_shopping_items_item_id(checked_item.id),
|
||||
json=utils.jsonify(checked_item.dict()),
|
||||
json=utils.jsonify(checked_item.model_dump()),
|
||||
headers=unique_user.token,
|
||||
)
|
||||
|
||||
|
@ -396,7 +396,7 @@ def test_shopping_list_items_checked_off(
|
|||
# get the reference item and make sure it didn't change
|
||||
response = api_client.get(api_routes.groups_shopping_items_item_id(reference_item.id), headers=unique_user.token)
|
||||
as_json = utils.assert_derserialize(response, 200)
|
||||
reference_item_get = ShoppingListItemOut.parse_obj(as_json)
|
||||
reference_item_get = ShoppingListItemOut.model_validate(as_json)
|
||||
|
||||
assert reference_item_get.id == reference_item.id
|
||||
assert reference_item_get.shopping_list_id == reference_item.shopping_list_id
|
||||
|
@ -407,7 +407,7 @@ def test_shopping_list_items_checked_off(
|
|||
# rename an item to match another item and check both off, and make sure they are not merged
|
||||
response = api_client.get(api_routes.groups_shopping_lists_item_id(list_with_items.id), headers=unique_user.token)
|
||||
as_json = utils.assert_derserialize(response, 200)
|
||||
updated_list = ShoppingListOut.parse_obj(as_json)
|
||||
updated_list = ShoppingListOut.model_validate(as_json)
|
||||
|
||||
item_1, item_2 = random.sample(updated_list.list_items, 2)
|
||||
item_1.checked = True
|
||||
|
@ -416,7 +416,7 @@ def test_shopping_list_items_checked_off(
|
|||
|
||||
response = api_client.put(
|
||||
api_routes.groups_shopping_items,
|
||||
json=utils.jsonify([item_1.dict(), item_2.dict()]),
|
||||
json=utils.jsonify([item_1.model_dump(), item_2.model_dump()]),
|
||||
headers=unique_user.token,
|
||||
)
|
||||
|
||||
|
|
|
@ -161,7 +161,9 @@ def test_shopping_lists_add_one_with_zero_quantity(
|
|||
response = api_client.put(f"{api_routes.recipes}/{recipe_slug}", json=recipe_data, headers=unique_user.token)
|
||||
utils.assert_derserialize(response, 200)
|
||||
|
||||
recipe = Recipe.parse_raw(api_client.get(f"{api_routes.recipes}/{recipe_slug}", headers=unique_user.token).content)
|
||||
recipe = Recipe.model_validate_json(
|
||||
api_client.get(f"{api_routes.recipes}/{recipe_slug}", headers=unique_user.token).content
|
||||
)
|
||||
assert recipe.id
|
||||
assert len(recipe.recipe_ingredient) == 3
|
||||
|
||||
|
@ -172,7 +174,7 @@ def test_shopping_lists_add_one_with_zero_quantity(
|
|||
)
|
||||
|
||||
response = api_client.get(api_routes.groups_shopping_lists_item_id(shopping_list.id), headers=unique_user.token)
|
||||
shopping_list_out = ShoppingListOut.parse_obj(utils.assert_derserialize(response, 200))
|
||||
shopping_list_out = ShoppingListOut.model_validate(utils.assert_derserialize(response, 200))
|
||||
|
||||
assert len(shopping_list_out.list_items) == 3
|
||||
|
||||
|
@ -285,7 +287,9 @@ def test_shopping_lists_add_recipe_with_merge(
|
|||
response = api_client.put(f"{api_routes.recipes}/{recipe_slug}", json=recipe_data, headers=unique_user.token)
|
||||
utils.assert_derserialize(response, 200)
|
||||
|
||||
recipe = Recipe.parse_raw(api_client.get(f"{api_routes.recipes}/{recipe_slug}", headers=unique_user.token).content)
|
||||
recipe = Recipe.model_validate_json(
|
||||
api_client.get(f"{api_routes.recipes}/{recipe_slug}", headers=unique_user.token).content
|
||||
)
|
||||
assert recipe.id
|
||||
assert len(recipe.recipe_ingredient) == 4
|
||||
|
||||
|
@ -296,7 +300,7 @@ def test_shopping_lists_add_recipe_with_merge(
|
|||
)
|
||||
|
||||
response = api_client.get(api_routes.groups_shopping_lists_item_id(shopping_list.id), headers=unique_user.token)
|
||||
shopping_list_out = ShoppingListOut.parse_obj(utils.assert_derserialize(response, 200))
|
||||
shopping_list_out = ShoppingListOut.model_validate(utils.assert_derserialize(response, 200))
|
||||
|
||||
assert len(shopping_list_out.list_items) == 3
|
||||
|
||||
|
@ -635,7 +639,9 @@ def test_recipe_manipulation_with_zero_quantities(
|
|||
response = api_client.put(f"{api_routes.recipes}/{recipe_slug}", json=recipe_data, headers=unique_user.token)
|
||||
utils.assert_derserialize(response, 200)
|
||||
|
||||
recipe = Recipe.parse_raw(api_client.get(f"{api_routes.recipes}/{recipe_slug}", headers=unique_user.token).content)
|
||||
recipe = Recipe.model_validate_json(
|
||||
api_client.get(f"{api_routes.recipes}/{recipe_slug}", headers=unique_user.token).content
|
||||
)
|
||||
assert recipe.id
|
||||
assert len(recipe.recipe_ingredient) == 4
|
||||
|
||||
|
@ -653,7 +659,7 @@ def test_recipe_manipulation_with_zero_quantities(
|
|||
utils.assert_derserialize(response, 200)
|
||||
|
||||
response = api_client.get(api_routes.groups_shopping_lists_item_id(shopping_list.id), headers=unique_user.token)
|
||||
updated_list = ShoppingListOut.parse_raw(response.content)
|
||||
updated_list = ShoppingListOut.model_validate_json(response.content)
|
||||
assert len(updated_list.list_items) == 4
|
||||
|
||||
found = False
|
||||
|
@ -679,7 +685,7 @@ def test_recipe_manipulation_with_zero_quantities(
|
|||
)
|
||||
|
||||
response = api_client.get(api_routes.groups_shopping_lists_item_id(shopping_list.id), headers=unique_user.token)
|
||||
updated_list = ShoppingListOut.parse_raw(response.content)
|
||||
updated_list = ShoppingListOut.model_validate_json(response.content)
|
||||
assert len(updated_list.list_items) == 4
|
||||
|
||||
found = False
|
||||
|
@ -705,7 +711,7 @@ def test_recipe_manipulation_with_zero_quantities(
|
|||
)
|
||||
|
||||
response = api_client.get(api_routes.groups_shopping_lists_item_id(shopping_list.id), headers=unique_user.token)
|
||||
updated_list = ShoppingListOut.parse_raw(response.content)
|
||||
updated_list = ShoppingListOut.model_validate_json(response.content)
|
||||
assert len(updated_list.list_items) == 0
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ def create_labels(api_client: TestClient, unique_user: TestUser, count: int = 10
|
|||
labels: list[MultiPurposeLabelOut] = []
|
||||
for _ in range(count):
|
||||
response = api_client.post(api_routes.groups_labels, json={"name": random_string()}, headers=unique_user.token)
|
||||
labels.append(MultiPurposeLabelOut.parse_obj(response.json()))
|
||||
labels.append(MultiPurposeLabelOut.model_validate(response.json()))
|
||||
|
||||
return labels
|
||||
|
||||
|
@ -25,7 +25,7 @@ def test_new_list_creates_list_labels(api_client: TestClient, unique_user: TestU
|
|||
response = api_client.post(
|
||||
api_routes.groups_shopping_lists, json={"name": random_string()}, headers=unique_user.token
|
||||
)
|
||||
new_list = ShoppingListOut.parse_obj(response.json())
|
||||
new_list = ShoppingListOut.model_validate(response.json())
|
||||
|
||||
assert len(new_list.label_settings) == len(labels)
|
||||
label_settings_label_ids = [setting.label_id for setting in new_list.label_settings]
|
||||
|
@ -39,13 +39,13 @@ def test_new_label_creates_list_labels(api_client: TestClient, unique_user: Test
|
|||
response = api_client.post(
|
||||
api_routes.groups_shopping_lists, json={"name": random_string()}, headers=unique_user.token
|
||||
)
|
||||
new_list = ShoppingListOut.parse_obj(response.json())
|
||||
new_list = ShoppingListOut.model_validate(response.json())
|
||||
existing_label_settings = new_list.label_settings
|
||||
|
||||
# create more labels and make sure they were added to the list's label settings
|
||||
new_labels = create_labels(api_client, unique_user)
|
||||
response = api_client.get(api_routes.groups_shopping_lists_item_id(new_list.id), headers=unique_user.token)
|
||||
updated_list = ShoppingListOut.parse_obj(response.json())
|
||||
updated_list = ShoppingListOut.model_validate(response.json())
|
||||
updated_label_settings = updated_list.label_settings
|
||||
assert len(updated_label_settings) == len(existing_label_settings) + len(new_labels)
|
||||
|
||||
|
@ -66,7 +66,7 @@ def test_seed_label_creates_list_labels(database: AllRepositories, api_client: T
|
|||
response = api_client.post(
|
||||
api_routes.groups_shopping_lists, json={"name": random_string()}, headers=unique_user.token
|
||||
)
|
||||
new_list = ShoppingListOut.parse_obj(response.json())
|
||||
new_list = ShoppingListOut.model_validate(response.json())
|
||||
existing_label_settings = new_list.label_settings
|
||||
|
||||
# seed labels and make sure they were added to the list's label settings
|
||||
|
@ -75,7 +75,7 @@ def test_seed_label_creates_list_labels(database: AllRepositories, api_client: T
|
|||
seeder.seed_labels("en-US")
|
||||
|
||||
response = api_client.get(api_routes.groups_shopping_lists_item_id(new_list.id), headers=unique_user.token)
|
||||
updated_list = ShoppingListOut.parse_obj(response.json())
|
||||
updated_list = ShoppingListOut.model_validate(response.json())
|
||||
updated_label_settings = updated_list.label_settings
|
||||
assert len(updated_label_settings) == len(existing_label_settings) + CREATED_LABELS
|
||||
|
||||
|
@ -89,14 +89,14 @@ def test_delete_label_deletes_list_labels(api_client: TestClient, unique_user: T
|
|||
response = api_client.post(
|
||||
api_routes.groups_shopping_lists, json={"name": random_string()}, headers=unique_user.token
|
||||
)
|
||||
new_list = ShoppingListOut.parse_obj(response.json())
|
||||
new_list = ShoppingListOut.model_validate(response.json())
|
||||
|
||||
existing_label_settings = new_list.label_settings
|
||||
label_to_delete = random.choice(new_labels)
|
||||
api_client.delete(api_routes.groups_labels_item_id(label_to_delete.id), headers=unique_user.token)
|
||||
|
||||
response = api_client.get(api_routes.groups_shopping_lists_item_id(new_list.id), headers=unique_user.token)
|
||||
updated_list = ShoppingListOut.parse_obj(response.json())
|
||||
updated_list = ShoppingListOut.model_validate(response.json())
|
||||
assert len(updated_list.label_settings) == len(existing_label_settings) - 1
|
||||
|
||||
label_settings_label_ids = [setting.label_id for setting in updated_list.label_settings]
|
||||
|
@ -116,11 +116,11 @@ def test_update_list_doesnt_change_list_labels(api_client: TestClient, unique_us
|
|||
response = api_client.post(
|
||||
api_routes.groups_shopping_lists, json={"name": original_name}, headers=unique_user.token
|
||||
)
|
||||
new_list = ShoppingListOut.parse_obj(response.json())
|
||||
new_list = ShoppingListOut.model_validate(response.json())
|
||||
assert new_list.name == original_name
|
||||
assert new_list.label_settings
|
||||
|
||||
updated_list_data = new_list.dict()
|
||||
updated_list_data = new_list.model_dump()
|
||||
updated_list_data.pop("created_at", None)
|
||||
updated_list_data.pop("update_at", None)
|
||||
|
||||
|
@ -132,7 +132,7 @@ def test_update_list_doesnt_change_list_labels(api_client: TestClient, unique_us
|
|||
json=jsonify(updated_list_data),
|
||||
headers=unique_user.token,
|
||||
)
|
||||
updated_list = ShoppingListOut.parse_obj(response.json())
|
||||
updated_list = ShoppingListOut.model_validate(response.json())
|
||||
assert updated_list.name == updated_name
|
||||
assert updated_list.label_settings == new_list.label_settings
|
||||
|
||||
|
@ -142,7 +142,7 @@ def test_update_list_labels(api_client: TestClient, unique_user: TestUser):
|
|||
response = api_client.post(
|
||||
api_routes.groups_shopping_lists, json={"name": random_string()}, headers=unique_user.token
|
||||
)
|
||||
new_list = ShoppingListOut.parse_obj(response.json())
|
||||
new_list = ShoppingListOut.model_validate(response.json())
|
||||
changed_setting = random.choice(new_list.label_settings)
|
||||
changed_setting.position = random_int(999, 9999)
|
||||
|
||||
|
@ -151,7 +151,7 @@ def test_update_list_labels(api_client: TestClient, unique_user: TestUser):
|
|||
json=jsonify(new_list.label_settings),
|
||||
headers=unique_user.token,
|
||||
)
|
||||
updated_list = ShoppingListOut.parse_obj(response.json())
|
||||
updated_list = ShoppingListOut.model_validate(response.json())
|
||||
|
||||
original_settings_by_id = {setting.id: setting for setting in new_list.label_settings}
|
||||
for setting in updated_list.label_settings:
|
||||
|
@ -170,7 +170,7 @@ def test_list_label_order(api_client: TestClient, unique_user: TestUser):
|
|||
response = api_client.post(
|
||||
api_routes.groups_shopping_lists, json={"name": random_string()}, headers=unique_user.token
|
||||
)
|
||||
new_list = ShoppingListOut.parse_obj(response.json())
|
||||
new_list = ShoppingListOut.model_validate(response.json())
|
||||
for i, setting in enumerate(new_list.label_settings):
|
||||
if not i:
|
||||
continue
|
||||
|
@ -183,7 +183,7 @@ def test_list_label_order(api_client: TestClient, unique_user: TestUser):
|
|||
json=jsonify(new_list.label_settings),
|
||||
headers=unique_user.token,
|
||||
)
|
||||
updated_list = ShoppingListOut.parse_obj(response.json())
|
||||
updated_list = ShoppingListOut.model_validate(response.json())
|
||||
for i, setting in enumerate(updated_list.label_settings):
|
||||
if not i:
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue