Part of twistar.validation View In Hierarchy
Known subclasses: twistar.dbobject.DBObject
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 0 | Class Variable | VALIDATIONS | A list of functions to call when testing whether or not a
particular instance is valid. |
| 95 | Class Method | clearValidations | Clear the given class's validations. |
| 103 | Class Method | addValidator | Add a function to the given classes validation list. |
| 121 | Class Method | validatesPresenceOf | A validator to test whether or not some named properties are set. For
those named properties that are not set, an error will be recorded in
obj.errors. |
| 137 | Class Method | validatesUniquenessOf | A validator to test whether or not some named properties are unique. For
those named properties that are not unique, an error will be recorded in
obj.errors. |
| 153 | Class Method | validatesLengthOf | No summary |
| 175 | Class Method | _validate | Validate a given object using all of the set validators for the objects
class. If errors are found, they will be recorded in the objects
errors property. |
list of functions to call when testing whether or not a
particular instance is valid.
| Parameters | klass | The Class to add the validator to. |
| func | A function that accepts a single parameter that is the object to test for
validity. If the object is invalid, then this function should add errors
to it's errors property. | |
| See Also | Errors | |
obj.errors.| Parameters | klass | The klass whose properties need to be tested. |
| names | The names of the properties to test. | |
| kwargs | Keyword arguments. Right now, all but a message value are
ignored. |
obj.errors.| Parameters | klass | The klass whose properties need to be tested. |
| names | The names of the properties to test. | |
| kwargs | Keyword arguments. Right now, all but a message value are
ignored. |
range keyword set with a range /
xrange / list object containing valid values, or
a length keyword with the exact length allowed.
For those named properties that do not have the specified length, an
error will be recorded in the instance of klass's
errors parameter.
| Parameters | klass | The klass whose properties need to be tested. |
| names | The names of the properties to test. | |
| kwargs | Keyword arguments. Right now, all but message,
range, and length values are ignored. |
errors property.| Returns | A Deferred whose callback will receive the given object. | |
| See Also | Errors | |