def validate_activatable_models():
for model in get_activatable_models():<EOL><INDENT>activatable_field = next((<EOL>f for f in model._meta.fields<EOL>if f.__class__ == models.BooleanField and f.name == model.ACTIVATABLE_FIELD_NAME<EOL>), None)<EOL>if activatable_field is None:<EOL><INDENT>raise ValidationError((<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(model)<EOL>))<EOL><DEDENT>if not model.ALLOW_CASCADE_DELETE:<EOL><INDENT>for field in model._meta.fields:<EOL><INDENT>if field.__class__ in (models.ForeignKey, models.OneToOneField):<EOL><INDENT>if field.remote_field.on_delete == models.CASCADE:<EOL><INDENT>raise ValidationError((<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>).format(model))<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>
Raises a ValidationError for any ActivatableModel that has ForeignKeys or OneToOneFields that will
cause cascading deletions to occur. This function also raises a ValidationError if the activatable
model has not defined a Boolean field with the field name defined by the ACTIVATABLE_FIELD_NAME variable
on the model.