On Nov 2, 4:56 pm, Ed Valentine <
ed.j.valent...@gmail.com> wrote:
> I would like to pretty-up the display and add lines, boxes and place
> the individual field widgets on the page and still use TG2 and a
> single controller. Is this possible? If so, are there any examples?
Depending on how involved you want to get, you could either rewrite
the template that is used to create the form (TableForm,ListForm), or,
create a template that places the form fields where you want without
using TableForm/ListForm, or, create widgets to insert items in the
default template.
I've written two widgets for a project and it isn't too difficult.
I've also modified the default render template because help_text and
error_messages get appended to the end of the input object which
causes some lines to wrap which makes things a bit unreadable. I've
also added a red * next to required fields.
class NewWidgetForm(TableForm):
action = '/tools/widgetsave'
submit_text = 'Submit Widget'
template = 'cp.templates.form'
I modified form.mako in my templates directory, taken from the .egg.
The widgets were created based on:
http://toscawidgets.org/documentation/ToscaWidgets/create.html