I'm trying to implement a unique field
code for a dexterity content type and added already a validator:
class IPatient(model.Schema): code = schema.TextLine( title=_(u"label_patient_code", default=u"Tax/Fiscal Code"), description=_(u"Patient unique Tax/Fiscal Code"), required=True) @invariant def validate_code(data): """Checks if the patient code is unique """ ... (catalog search) ...
However, since this validator lives in the interface, I can not check if the current value of the field was changed after edit or not. Therefore, my validator fails obviously for each edit.
What would be the best approach to check if the value was changed or not?
I have already seen the data converters in
z3c.form.converter. Would this be the right way to handle that or in a custom edit view in
Thanks in advance