AttributeError: 'ForeignKeyField' object has no attribute 'to' #120

kolanos opened this Issue Oct 17, 2012 · 1 comment


None yet

2 participants

kolanos commented Oct 17, 2012

The create_foreign_key() function appears to be referencing an attribute that doesn't exist:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "env/local/lib/python2.7/site-packages/", line 2003, in create_table
    db.create_foreign_key(cls, field_obj)
  File "env/local/lib/python2.7/site-packages/", line 1739, in create_foreign_key,
AttributeError: 'ForeignKeyField' object has no attribute 'to'

This occurs while running create_table() on a model that has a ForeignKeyField().

Running peewee version 2.0.2.

@coleifer coleifer closed this in f4aae76 Oct 17, 2012
kolanos commented Oct 29, 2012

Thanks for fixing this one so quickly! When is the next release planned? Right now I'm using the master branch to get around this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment