

def _create_foreign_key(self, model_class, field, constraint=None):
    constraint = (constraint or ('fk_%s_%s_refs_%s' % (fk_clause._meta.db_table, field.db_column, field.rel_model._meta.db_table)))
    fk_clause = self.foreign_key_constraint(field)
    return Clause(SQL('ALTER TABLE'), model_class.as_entity(), SQL('ADD CONSTRAINT'), Entity(constraint), *fk_clause.nodes)

dataset/ETHPy150Open coleifer/peewee/peewee.py QueryCompiler._create_foreign_key/VarMisuse@27/43 `model_class`->`fk_clause`