Not unique table/alias in a single INNER JOIN query
Just an FYI that the `filter()` API is actually deprecated.

That aside, it looks like it's interpreting the foreign key as a column requiring a join. This query should accomplish what you want:

``` python
DataRow.select().where(DataRow.parent == 1234)
```

Also, if you find yourself wanting to perform a join on the parent row, you need to use [Model.alias()](http://docs.peewee-orm.com/en/latest/peewee/api.html#Model.alias).

Hi,

I have a model DataRow which has a foreign key to itself (you can see it below). This query

```
DataRow.filter(parent=1864)
```

caused the following error:

```
InternalError: (1066, u"Not unique table/alias: 't1'")
```

Here is the SQL that was executed:

```
Error executing query 
SELECT t1.`id`, t1.`data`, t1.`parent_id`, t1.`board_id`, t1.`order`, t1.`colour` 
FROM `datarow` AS t1 INNER JOIN `datarow` AS t1 ON (t1.`parent_id` = t1.`id`) WHERE 
(t1.`parent_id` = %s) ([1864])
```

Here is the data model:

```
import peewee
from flask_peewee.db import Database

app = Flask(__name__, static_url_path='/assets')
db = Database(app)

class DataRow(db.Model):
    DEFAULT_ROW_COLOUR = '#ffffff'

    data = peewee.TextField()
    parent = peewee.ForeignKeyField('self', null=True, blank=True)
    board = peewee.ForeignKeyField(Board)
    order = peewee.FloatField(null=True)
    colour = peewee.CharField(default=DEFAULT_ROW_COLOUR)
```

Even though I may have made  some mistake in data modeling or in my peewee usage, I think I shouldn't be getting this error, right?

Thanks
