Peewee throws error on cascade deletion if imports aren't present
Please read the documentation on submitting bugs: http://docs.peewee-orm.com/en/latest/peewee/contributing.html#bugs

Specifically, take the extra 5 seconds and please format your code:

https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/

I have something similar to this:

class Test(BaseModel):
    name = CharField()

class Test2(BaseModel):
    test = ForeignKeyField(Test)

class Test3(BaseModel):
    test2 = ForeignKeyField(Test2)

I had a script that said:

from database.model.test import Test
test = Test.get(Test.name == testName)
test.delete_instance(recursive=True, delete_nullable=True)

And it threw something along this:

_mysql_exceptions.IntegrityError: (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`mydatabase`.`test3`, CONSTRAINT `test3_ibfk_1` FOREIGN KEY (`test2_id`) REFERENCES `test2` (`id`))')

And it fixed itself only when I added the imports for the dependent models like this:

from database.model.test import Test
from database.model.test2 import Test2
from database.model.test3 import Test3
test = Test.get(Test.name == testName)
test.delete_instance(recursive=True, delete_nullable=True)

This poses the problem that some linters are going to complain about unused imports, I don't know if something can be done to improve this though. Also, I found out what the problem was only by chance, maybe capturing these exceptions and showing some hint to the users that the imports are needed could help someone else.

Thanks!
