Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Private Attributes
validation.validators.SupplValidators.DateValidator Class Reference

List of all members.

Public Member Functions

def __init__
def __call__

Public Attributes

 name
 title
 description

Static Private Attributes

 __implements__ = IValidator

Detailed Description

Definition at line 89 of file SupplValidators.py.


Constructor & Destructor Documentation

def validation.validators.SupplValidators.DateValidator.__init__ (   self,
  name,
  title = '',
  description = '' 
)

Definition at line 93 of file SupplValidators.py.

00093 
00094     def __init__(self, name, title='', description=''):
00095         self.name = name
00096         self.title = title or name
00097         self.description = description


Member Function Documentation

def validation.validators.SupplValidators.DateValidator.__call__ (   self,
  value,
  args,
  kwargs 
)

Definition at line 98 of file SupplValidators.py.

00098 
00099     def __call__(self, value, *args, **kwargs):
00100         if not value:
00101             return ("Validation failed(%s): value is "
00102                     "empty (%s)." % (self.name, repr(value)))
00103         if not isinstance(value, DateTime):
00104             try:
00105                 value = DateTime(value)
00106             except:
00107                 return ("Validation failed(%s): could not "
00108                         "convert %s to a date.""" % (self.name, value))
00109         return True
00110 


Member Data Documentation

Definition at line 91 of file SupplValidators.py.

Definition at line 96 of file SupplValidators.py.

Definition at line 94 of file SupplValidators.py.

Definition at line 95 of file SupplValidators.py.


The documentation for this class was generated from the following file: