def validator(node, value): if not Tva.unique_value(value, current_id): raise colander.Invalid(node, TVA_UNIQUE_VALUE_MSG)