t.v.Errors(dict) : class documentation

Part of twistar.validation View In Hierarchy

A class to hold errors found during validation of a DBObject.
Line # Kind Name Docs
195 Method __init__ Constructor.
202 Method add No summary
218 Method isEmpty Returns True if there are any errors associated with any properties, False otherwise.
229 Method errorsFor Get the errors for a specific property.
241 Method __str__ Return all errors as a single string.
254 Method __len__ Get the sum of all errors for all properties.
def __init__(self):
Constructor.
def add(self, prop, error):
Add an error to a property. The error message stored for this property will be formed from the humanized name of the property followed by the error message given. For instance, errors.add('first_name', 'cannot be empty') will result in an error message of "First Name cannot be empty" being stored for this property.
ParameterspropThe name of a property to add an error to.
errorA string error to associate with the given property.
def isEmpty(self):
Returns True if there are any errors associated with any properties, False otherwise.
def errorsFor(self, prop):
Get the errors for a specific property.
ParameterspropThe property to fetch errors for.
ReturnsA list of errors for the given property. If there are none, then the returned list will have a length of 0.
def __str__(self):
Return all errors as a single string.
def __len__(self):
Get the sum of all errors for all properties.
API Documentation for twistar, generated by pydoctor at 2012-06-12 10:00:49.