camelot :: admin :: validator :: object_validator :: ObjectValidator :: Class ObjectValidator
[frames] | no frames]

Class ObjectValidator


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.
Instance Methods
 
__init__(self, admin, model, initial_validation=False)
since this might take a lot of time on large collections.
 
data_changed(self, from_index, thru_index)
 
isValid(self, row)
Verify if a row in a model is 'valid' meaning it could be flushed to the database
 
layout_changed(self)
 
number_of_invalid_rows(self)
Returns: the number of invalid rows in a model, as they have been verified
 
objectValidity(self, entity_instance)
empty list if object is valid
 
validate_all_rows(self)
Force validation of all rows in the model
 
validate_invalid_rows(self)
 
validityDialog(self, row, parent)
Return a QDialog that asks the user to discard his changes or continue to edit the row until it is valid.
 
validityMessages(self, row)

Inherited from PyQt4.QtCore.QObject: blockSignals, childEvent, children, connect, connectNotify, customEvent, deleteLater, destroyed, disconnect, disconnectNotify, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, emit, event, eventFilter, findChild, findChildren, inherits, installEventFilter, isWidgetType, killTimer, metaObject, moveToThread, objectName, parent, property, pyqtConfigure, receivers, removeEventFilter, sender, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent, tr, trUtf8

Inherited from sip.simplewrapper: __delattr__, __getattribute__, __new__, __setattr__

Inherited from object: __format__, __hash__, __reduce__, __reduce_ex__, __repr__, __sizeof__, __str__, __subclasshook__

Class Variables
  validity_changed_signal = '2validityChanged'

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Properties

Inherited from object: __class__

Method Details

__init__(self, admin, model, initial_validation=False)
(Constructor)

 
since this might take a lot of time on large collections.
Parameters:
  • verifiy_initial_validity - do an inital check to see if all rows in a model are valid, defaults to False,
Overrides: object.__init__

number_of_invalid_rows(self)

 
Returns:
the number of invalid rows in a model, as they have been verified

objectValidity(self, entity_instance)

 
empty list if object is valid
Returns:
list of messages explaining invalid data