Mike Kent wrote:
>
> One thing I learned while doing this project is the current Widget base
> class is very form-input oriented. I see from comments from Kevin and
> Karl that what I set out to do is not really in line with the original
> intended use for widgets. It may be a mistake to limit our scope. We
> might want to take a look at refactoring the current Widget base class
> to move the form-input code out to a new 'FormWidget' class that would
> be the base class of form-oriented classes.
>
+1
I've proposed this to Kevin some times ago, I also made a small patch
but abandoned it since I'm lacking free time to hack ATM. :-(
I really think (as you said) we should keep the Widget base class as
essential as possible, the widget system Kevin has made is really nice
and reusable not only for Form input operations but to make reusable
component (that even comes with the right css and js).
My ideal vision:
Widget
|__ TagWidget
|__ FormField
TagWidget is a widget whose output/template is just a single tag and
hence supports attributes using py:attrs.
CompoundWidget (or ContainerWidget)
|__ Form
I think TG should just focus on providing Form-oriented widgets and
entry-points for thirdparty widgets.
Ciao
Michele