object_validator

class camelot.admin.validator.object_validator.ObjectValidator(admin, model, 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.

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]
Returns:list of messages explaining invalid data

empty list if object is valid

validate_all_rows()[source]

Force validation of all rows in the model

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


Comments
blog comments powered by Disqus