def METHOD_NAME(self, value):
    # Additional validation - value has been passed through compress() already
    if value.type.pk not in value.purpose.timeslot_types:
        raise forms.ValidationError(
            '"%(type)s" is not an allowed type for the purpose "%(purpose)s"',
            params={'type': value.type, 'purpose': value.purpose},
            code='invalid_type',
        )