def same_page_choosen(form, field):
if form._obj is not None:<EOL><INDENT>if field.data.id == form._obj.list_id:<EOL><INDENT>raise ValidationError(<EOL>_('<STR_LIT>'))<EOL><DEDENT><DEDENT>
Check that we are not trying to assign list page itself as a child.