def _set_parent(self, table):
        super(ForeignKeyConstraint, self)._set_parent(table)

        self._validate_dest_table(table)

        for col, fk in self._elements.items():
            # string-specified column names now get
            # resolved to Column objects
            if isinstance(col, util.string_types):
                try:
                    col = table.c[col]
                except __HOLE__:
                    raise exc.ArgumentError(
                        "Can't create ForeignKeyConstraint "
                        "on table '%s': no column "
                        "named '%s' is present." % (table.description, col))

            if not hasattr(fk, 'parent') or \
                    fk.parent is not col:
                fk._set_parent_with_dispatch(col)

        if self.use_alter:
            def supports_alter(ddl, event, schema_item, bind, **kw):
                return table in set(kw['tables']) and \
                    bind.dialect.supports_alter

            event.listen(table.metadata, "after_create",
                         ddl.AddConstraint(self, on=supports_alter))
            event.listen(table.metadata, "before_drop",
                         ddl.DropConstraint(self, on=supports_alter))
dataset/ETHPy150Open RoseOu/flasky/venv/lib/python2.7/site-packages/sqlalchemy/sql/schema.py/ForeignKeyConstraint._set_parent