maxfordham / ipyautoui

create ipywidgets user input form pydantic model or jsonschema
https://maxfordham.github.io/ipyautoui/
42 stars 4 forks source link

🐛 initialising AutoVjsf throws AttributeError #286

Closed tharwan closed 7 months ago

tharwan commented 7 months ago

Describe the bug when running the demo code for AutoVjsf, I get an AttributeError: 'AutoVjsf' object has no attribute 'hbx_title' in my environment.

To Reproduce Steps to reproduce the behavior:

  1. run the code from https://github.com/maxfordham/ipyautoui/blob/main/docs/autovuetify.ipynb

from ipyautoui import AutoVjsf import json from pydantic import BaseModel, Field from ipyautoui.constants import DIR_MODULE from ipyautoui._utils import display_pydantic_json

create a pydantic model (or a json-schema) defining the fields of interest

class AutoUiExample(BaseModel): text: str = Field(default="Test", description="This description is very important")

import pathlib

value = {"text": "this is a value"} ui = AutoVjsf(schema=AutoUiExample, value=value, path=pathlib.Path("test.json")) display(ui) # uncomment


2. see the error message

**Expected behavior**
a form is displayed
jgunstone commented 7 months ago

thanks for reporting - I made some changes to how the forms are build and didn't chase them through to AutoVjsf... applying a simple fix now

jgunstone commented 7 months ago

just released the fix with v0.7.10

tharwan commented 7 months ago

Many thanks! Unfortunately I was coming across this issue trying to use autoui with solara, which does not yet seam to work. I will open a separate issue so you can decide there if this is something to look into.