Closed saemideluxe closed 2 years ago
Okay, this is quite a big one. However, in a lot of places there happend just small changes due to how the API changed. The relevant changes are mainly in bread.layout.components.forms
. That package is not perfect yet, I see quite a few improvments on how we could restructure it. But we have to get this refactoring through at some point.
The main points of this refactoring were:
generate_widget_element
). Normally the later should be used, as it will create a fully "carbonized" widget. However, sometimes the "pure" version of the widget is desired.generate_widget_element
) which can be used to correctly generate a widget that depends on a Django form field. The function will take care to pass all relevant settings from the Django form field to the widget. The function tries to mimick the vanilla Django widget instantiation as closely as possible.Also: I added a preview page for widgets. I think we will write some additions there to show the widgets in different states, like with label, error message, disabled, etc.
Also also I think we should test this on connect.basx.ch before merging. We can install directly from this branch. And then let a few people test different areas.
Also also also, I did not yet test this with UM and Ponds, they will likely need a few small adjustments.
Work in progress