object_validator

class camelot.admin.validator.object_validator.ObjectValidator(admin, model=None, initial_validation=False)[source]

A validator class for normal python objects. By default this validator declares all objects valid. Subclass this class and overwrite it’s objectValidity method to change it’s behaviour.

Get the validator for another Class :param cls: the Class for which to get the validator :return: an ObjectValidator instance

isValid(row)[source]

Verify if a row in a model is ‘valid’ meaning it could be flushed to the database

number_of_invalid_rows()[source]
Returns:the number of invalid rows in a model, as they have been verified
objectValidity(entity_instance)[source]

deprecated, use validate_object instead

validate_all_rows()[source]

Force validation of all rows in the model

validate_object(obj)[source]
Returns:list of messages explaining invalid data

empty list if object is valid

validityDialog(row, parent)[source]

Return a QDialog that asks the user to discard his changes or continue to edit the row until it is valid.

Previous topic

entity_validator

Next topic

art

This Page