You are looking at an HTML rendering of the generated widgets, they are lacking responsiveness due to no Python kernel being available for callbacks.
Inline Editing with PydanticEditorMixinΒΆ
Use PydanticEditorMixin to attach an Edit/Save/Cancel toolbar to model instances.
[1]:
from pydantic import BaseModel, Field
from ipywidgets_jsonschema import PydanticEditorMixin
class SessionPreferences(PydanticEditorMixin, BaseModel):
username: str = "student01"
autosave: bool = True
refresh_interval_s: int = Field(30, ge=5, le=300)
preferences = SessionPreferences()
preferences.edit()
[2]:
preferences.model_dump()
[2]:
{'username': 'student01', 'autosave': True, 'refresh_interval_s': 30}