I am not currently using form widgets.

Is there a way to use form widgets, but still write the form content on the kid template?
I would need my controller to send the form to the template, to take values from it, like:

<form name="$formWidget.name">
   .....
</form>

I prefer my html on the template, as our web designer might want to modify it.

Could anyone recommend a good tutorial / doc on this?

Thanks!

On 10/5/06, Adam Jones <[EMAIL PROTECTED]> wrote:


Marco Mariani wrote:
> Adam Jones wrote:
> >> 3 - always write a form validator; have it "mess" with the DB and check
> >> everything is in place, maybe doing half the work of the save()
> >> method... not its job, I guess
> >>
> >
> > I actually like this solution.
> I'm unsure. Do people usually validate a form by taking all of the
> context into account? Or is a validator, after all, only interested the
> relationship between the form data?

I think I am probably in the minority on this opinion. Most people
probably like a stricter separation between form validation and
environment checking for the data. My understanding is that the typical
requirements for form validation are that the data meets certain
parameters (presence, content/structure restrictions, etc).

My preference would be to be able to write my controllers under the
assumption that all of the data they are working with is valid and
ready to be manipulated without any additional checking. It makes them
a lot simpler.

In practice, though, that often creates a race condition at any mutable
resource after validation but before the controller makes its changes.
I actually didn't think about this until just now, so I am glad we are
having this discussion. Luckily the stuff that I am working on involves
multiple users each having their own data, so there is no risk of
anyone stepping on someone else's information.

-Adam






--~--~---------~--~----~------------~-------~--~----~
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