validator Package

validator Package

Validator classes validate data before their GUI representation is closed by the user. The validator class also takes care of informing the user where the data is invalid.

This prevents the user from entering invalid data into the model or flushing it to the database.

entity_validator Module

class camelot.admin.validator.entity_validator.EntityValidator(admin, model, initial_validation=False)[source]

Bases: camelot.admin.validator.object_validator.ObjectValidator

A validator class validates an entity before flushing it to the database and provides the user with feedback if the entity is not ready to flush

object_validator Module

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

Bases: PyQt4.QtCore.QObject

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.

data_changed(from_index, thru_index)[source]
isValid(row)[source]

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

layout_changed()[source]
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

validate_invalid_rows()[source]
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.

validityMessages(row)[source]
validity_changed_signal

Table Of Contents

This Page


Comments
blog comments powered by Disqus