jmosbacher / pydantic-panel

Edit pydantic models with widgets from the awesome Panel package
MIT License
24 stars 3 forks source link

Add extension() function #21

Closed jmosbacher closed 1 year ago

jmosbacher commented 2 years ago

The PR adds dynamic loading of Pydantic pane so its only registered if requested explicitly. This addresses #14 but is also useful if someone may want to use the package widgets and utils but doesnt want to affect how pn.panel behaves.

This can be further improved by having settings passed to extension() that change how Pydantic pane behaves.

MarcSkovMadsen commented 2 years ago

I've asked in the pyviz/pyviz gitter channel what the HoloViz developers think about .extension() vs unused module imports.

image

jmosbacher commented 2 years ago

@MarcSkovMadsen thanks, i guess this is not very high priority so I dont mind waiting to see if any good ideas come up

jmosbacher commented 2 years ago

I think the correct approach here is using entry_points resolved from within panel.extension(). I will submit a PR to panel and see if they are open to such a thing.