Ignore:
Timestamp:
9 Jan 2010, 11:15:15 (15 years ago)
Author:
uli
Message:

Define a NullValidator? which does not perform validation. Needed for
cancel buttons and the like.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-layout/src/waeup/browser/layout.py

    r4692 r4756  
    1616
    1717grok.templatedir('templates')
     18
     19def NullValidator(*args, **kw):
     20    """A validator that does not validate.
     21
     22    This is needed especially for cancel buttons. We don't want data
     23    to be validated that will be thrown away in the next step.
     24
     25    You can use it with ``grok.action`` decorator like this::
     26
     27      @grok.action('Cancel', validator=NullValidator)
     28      def cancel(self, **data):
     29        self.redirect(<whereever-you-go>)
     30    """
     31    return dict()
    1832
    1933class UtilityView(object):
Note: See TracChangeset for help on using the changeset viewer.