Matt Wilson
unread,Nov 17, 2007, 6:20:29 PM11/17/07Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to tg.book
I didn't see this page mentioned in the errata.
This is the code I mean:
class ProjectFields(widgets.WidgetsList):
title = TextField(label="project",
validator=validators.NotEmpty())
client_revenue = widgets.TextField(validator=validators.Number())
project_form = widgets.TableForm(fields=ProjectFields(),
action="save_project_test")
One minor detail: this code uses widgets.TextField and TextField.
More importantly, I think the indentation is wrong in the last line.
I think project_form is not supposed to be a class attribute of the
ProjectField class.
Should the code look more like this?
class ProjectFields(widgets.WidgetsList):
title = widgets.TextField(label="project",
validator=validators.NotEmpty())
client_revenue = widgets.TextField(validator=validators.Number())
# Moved outside the class.
project_form = widgets.TableForm(fields=ProjectFields(),
action="save_project_test")
But maybe I'm missing something.
Matt