Closed MarcSkovMadsen closed 2 years ago
Im not sure I understand what you are proposing. Do you mean to split up the logic inside the for loop of pydantic_widgets to a separate function so people can use the function to get a single widget instead of a dictionary with widgets for each field? Or do mean to just make this function more accessible to users that want to create the widgets and modify them themselves?
I actually don't understand the implementation of pydantic-panel
yet. But what I propose is to expose functionality to create a single widget.
The motivation is that I have often seen with Param
that users ask for help to define or get hold of a single widget.
Ok, I guess I can add documentation for how to do this and maybe some more user friendly docstrings. Currently this function is just used internally.
This is now solved via Pydantic pane supporting arbitrary python objects.
e.g. for the above example pn.panel(example, start=0, end=100)
works.
With Panel you can (see)
Being able to create single widgets from Pydantic Model Attributes would be very useful as well. Some method like the below would be useful