Foreign Key Issue
What database engine are you using? That's definitely a bit odd.
 If you're using SQLite, you will need to execute `PRAGMA foreign_keys=on;` when you open a connection in order for this to work correctly.
 Thank you. I am using SQLite, and this seems to be the solution. :+1:
 The problem persists.

Tried executing `PRAGMA foreign_keys=on;` using Flasks `before_request` decorator like this

```
@app.before_request
def before_request():
    g.db = db
    g.db.execute_sql('PRAGMA foreign_keys=on')
    g.db.connect()
```

The problem still persists.
 You just need to swap so you execute the pragma statement **on** the new connection.

``` python
    g.db = db
    g.db.connect()
    g.db.execute_sql('PRAGMA foreign_keys=on')
```

Alternatively you could subclass `SqliteDatabase`:

``` python

class SqliteFKDatabase(SqliteDatabase):
    def _add_conn_hooks(self, conn):
        super(SqliteFKDatabase, self)._add_conn_hooks(conn)
        self.execute_sql('PRAGMA foreign_keys=on;')
```
 This seems not like a SQLite specific issue. Tried using MySQL too. The problem still persists. 
Wondering wether my model is right. Also `delete_instance()` is enough right?
 ``` python
from peewee import *

db = SqliteDatabase(':memory:')
db.execute_sql('pragma foreign_keys=on;')

class Base(Model):
    class Meta:
        database = db

class A(Base):
    data = IntegerField(default=0)

class B(Base):
    a = ForeignKeyField(A, on_delete='CASCADE')

db.create_tables([A, B])

a1 = A.create()
a2 = A.create()
for a in [a1, a2]:
    for i in range(3):
        B.create(a=a)

print B.select().count()
a1.delete_instance()
print B.select().count()
```

Prints:

```
6
3
```
 Thank you. I had got the concept wrong. 
Every thing is fine now :+1:

I just encountered this issue. Not sure if it had already been reported.

I have my models defined as follows

```
class BaseModel(Model):
    class Meta:
        database = db

class Login(BaseModel):
    username = TextField(unique=True)
    password = TextField()

class Profile(BaseModel):
    dname = TextField()
    about = TextField()
    photo = TextField()

class User(BaseModel):
    login = ForeignKeyField(Login, on_delete='CASCADE')
    profile = ForeignKeyField(Profile, null=True, 
                              on_delete='CASCADE')

```

When I call `user.delete_instance()` the record from user table is deleted, but record from login table persists. It is wrong right?
