From b6e5b5e3241e0c1fc9a3b8e046af7bc4a2b8e338 Mon Sep 17 00:00:00 2001 From: "Yakubov, Sergey" Date: Tue, 11 Feb 2025 14:35:21 -0500 Subject: [PATCH] a couple of fixes for section 6 --- episodes/06-Advanced-Data-Modeling.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/episodes/06-Advanced-Data-Modeling.md b/episodes/06-Advanced-Data-Modeling.md index 67e7f25e..c98e32f6 100755 --- a/episodes/06-Advanced-Data-Modeling.md +++ b/episodes/06-Advanced-Data-Modeling.md @@ -289,7 +289,7 @@ This command will download the template to a directory called `pydantic_mvvm`. C * **What is your project name?** - > Enter `Advanced Pydantic` + > Enter `Trame with Pydantic` * **What is your Python package name (use Python naming conventions)?** @@ -353,15 +353,18 @@ from ..models.settings import SettingsModel class MainViewModel: def __init__(self, _, binding: BindingInterface): self.settings = SettingsModel() - self.settings_bind = binding.new_bind(self.settings) - - def update_view(self): - self.settings_bind.update_in_view(self.settings) + self.settings_bind = binding.new_bind(self.settings) ``` 3. In your view, remove all other fields and add the following InputField (`src/trame_with_pydantic/app/views/main.py`) (Modify): ```python + + def __init__(self) -> None: + .... + self.view_model.settings_bind.connect("settings") + .... + ... with layout.content: with vuetify.VRow(align="center", classes="mt-4"): -- GitLab