Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1636 (closed defect: wontfix)

Opened 11 years ago

Last modified 10 years ago

Implement "Alberto style" validation decorator

Reported by: mramm Owned by: alberto
Priority: normal Milestone:
Component: TurboGears Version: trunk
Severity: normal Keywords:

Description (last modified by mramm) (diff)

The new TG2 validation decorator should be implemented as a hybrid of TG1 and pylons validators, as described by Alberto:

"What I'm planning to implement in the validate() decorator for TG2 is a much simpler and less powerful (but powerful enough, at least for the use-cases I've had) cross-breed between Pylons, TW's and TG1s validate() decorator. It would be used like:

@validate(my_form, error_handler="show_form")
def process_form(self, **kw)

There, error_handler is the *name* of the method, which must live in the same controller, that will redisplay the form in case of errors. This is the Pylons' heritage. The TG heritage comes from the fact that the validated values will be passed as arguments to the function (instead of being bound to the controller like Pylons does) and TW's phenotype is seen as the "form" argument which is a TW form (or any object that has a "validate" method)"

Change History

comment:1 Changed 11 years ago by mramm

  • Version changed from 1.0.4b3 to trunk
  • Milestone changed from 1.0.4 to 2.0

comment:2 Changed 11 years ago by mramm

  • Summary changed from Implement "alberty style" validation decorator to Implement "Alberto style" validation decorator

comment:3 Changed 11 years ago by mramm

  • Description modified (diff)

comment:4 Changed 11 years ago by mramm

  • Milestone changed from 2.0 to 2.0-preview

comment:5 Changed 11 years ago by mramm

  • Status changed from new to closed
  • Resolution set to wontfix

Unless there's a need for change, let's go with the current version. But we need to make a few improvements to that version, which I'll add in new tickets.

comment:6 Changed 10 years ago by anonymous

  • Milestone 2.0-preview-1 deleted

Milestone 2.0-preview-1 deleted

Note: See TracTickets for help on using tickets.