Creating forms in KARL3 is relatively easy. We’re using tools and approaches common to other Python web frameworks: ToscaWidgets, FormEncode, etc. More specifically, we’re not trying to do schema-driven, autogenerated, CRUD forms.
We currently do forms like this:
2) The forms are almost aways collections of the same, already-defined fields (title, text, privacy, etc.)
3) We have some custom widgets in Mako and some custom validators in FormEncode.
4) We have a thin concept called a “FormController”. It knows when a form was submitted, when a form was valid, and how to get/set content in bulk. (We hate that part.) Otherwise, everything else is stock TW and FormEncode.
5) View functions are responsible for instantiating a form, making a form controller, doing branching, and updating the model.
Performance. For whatever reason, TW is slow.
simple customization to a widget. Like so many frameworks, TW wants to do a lot. Making it somewhat challenging to dive in. Its documentation story isn’t as good as it looked at first. Finally, Mako has a certain “designed by the Perl guys” kind of attractiveness.
where to go. Related to other irritants listed here.
hammer factory factory factories. We don’t really need the pluggability and features that we’re paying the price for in TW.
Over Christmas we did some work at ripping out TW. For the most part, we got far enough to know what we want (described below). However, we don’t have time to convert everything, including the tests and widgets, nor finish the use cases listed below.
In a nutshell, it looked like this:
In our first cut, we went from around 38 requests/second to around 300 requests per second on an add form. Debuggability and test ability went up by a similar factor.