Select by foreign key doesn't works as expected
Thanks for the succinct issue report. For now I've made a provisional fix which correctly delegates to the `ForeignKeyField.db_value()` method when a model instance is converted. The fix is not perfect since we still want a way to convert model instances when a converter is present (but is not able to handle the given model instance), so I am catching possible `TypeError` or `ValueError`. I believe this should work in practice and have put some new tests in place. Many thanks.
Hello. We have the foreign keys with related field that is not equal the primary key to the related model.
The following code snippet shows an invalid SELECT query when we use in the select query related model object instead of just identifier.
```
from peewee import *

db = SqliteDatabase(':memory:')


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


class A(Base):
    id = AutoField()
    a_id = CharField(unique=True, max_length=24)


class B(Base):
    id = AutoField()
    a = ForeignKeyField(A, field="a_id")


db.create_tables([A, B])

a = A.create(a_id="example")
b = B.create(a=a)
print(B.select().where(B.a == b.a).sql())
print(B.select().where(B.a == b.a_id).sql())
```
Output:
```
('SELECT "t1"."id", "t1"."a_id" FROM "b" AS "t1" WHERE ("t1"."a_id" = ?)', [1])
('SELECT "t1"."id", "t1"."a_id" FROM "b" AS "t1" WHERE ("t1"."a_id" = ?)', ['example'])

```
Thanks