Hey guys

I've just started a Turbogears project (.9a1) to see if it really could
help me speed up my web application development (short answer: it
didn't). However, I thought it might be useful for me to let you know
my thoughts on the form widgets work coming from a PHP developer's POV.

My code was basically this:

class RegisterForm(widgets.WidgetsDeclaration):
        userId = widgets.TextField("Username")
        password = widgets.PasswordField("Password")
        emailAddress = widgets.TextField("E-mail address")
        displayName = widgets.TextField("What do you like to be called?")
        firstname = widgets.TextField("First name")
        lastname = widgets.TextField("Last name")

and then:

        @turbogears.expose(html=".templates.register")
        def register(self):
                register_form = widgets.TableForm(fields=RegisterForm(),
submit_text="Register")
                return dict(form=register_form)

I'm probably doing it wrong (which is not the point), but intuitively
you would expect to get form fields with the name attribute as the
RegisterForm members, with the label values as the TextField parameter.
What I got was the label values at the TextField parameter, which was..
wrong. Maybe there's a keyword argument I should have been setting, but
I think the way I thought it should be is the most intuitive way of
doing it (by definition, I guess).

Anyway, now I'm doing it the manual way, which sucks because I have to
type "username" five times to get the result I want. As a profession
PHP programmer, I know from experience that at least 50% of my time
goes in to form generation, collection and validation. If Turbogears
really wants to be a RAD tool, this really needs to be sorted out :-/

Apologies if this is fixed in SVN, I'm not running SVN because I need
to keep my environment stable - I'm hoping this project's completion
will coincide with the 0.9 release. About 3 months, right?

Cheers

-Rob


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to