classifier.forms

ClassifierFormMixin

class classifier.forms.ClassifierFormMixin(*args, **kwargs)[source]

Formset form mixin to enable validation for value connected to classifier.

CLASSIFIER_VALUE_FIELD = None

Name of field for value used in relation with classifier

classifier_label_fieldname
Returns:Return name of field that is relation to end model inherited from ClassifierLabelAbstract
Raises:ClassifierLabelModelNotFound – if field can not be found
classifier_label_model
Returns:end model inherited from ClassifierLabelAbstract used in current form
Raises:ClassifierLabelModelNotFound – if related field wasn’t found
setup_value_validators()[source]

Attach validator for value field specified in CLASSIFIER_VALUE_FIELD

Raises:NoValueFieldNameSpecified – if CLASSIFIER_VALUE_FIELD is blank
validate_value_field()[source]

Validate value based on classifier record.

Will be attathed to right field by call setup_value_validators() in __init__()