Not able to query in ForeignKeyField
You're close, you would write it as:

``` python
MenuItem.select().join(Restaurant).where(Restaurant.name == name)

MenuItem.select().where(MenuItem.restaurant == restaurant_id)
```
 Thanks

My `model.py`

```python
    from peewee import Model, CharField
    from playhouse.sqlite_ext import ForeignKeyField
    from playhouse.pool import SqliteExtDatabase
    
    import settings
    
    db = SqliteExtDatabase(settings.DB_NAME)
    
    
    class BaseModel(Model):
        """A base model that will use our Sqlite database"""
        class Meta:
            database = db
    
    
    class Restaurant(BaseModel):
        """ORM model of the Restaurant table"""
        name = CharField(null=False)
    
    
    class MenuItem(BaseModel):
        """ORM model of the MenuItem table"""
        name = CharField(null=False)
        course = CharField()
        description = CharField()
        price = CharField()
        restaurant = ForeignKeyField(Restaurant, null=False, db_column='restaurant_id')

```

When I am trying to query like this I am getting following error:

```
In [5]: menu = MenuItem.select().where(MenuItem.restaurant.id == 2).first()
    ---------------------------------------------------------------------------
    AttributeError                            Traceback (most recent call last)
    <ipython-input-5-4a02ff7da8b8> in <module>()
    ----> 1 menu = MenuItem.select().where(MenuItem.restaurant.id == 2).first()
    
    AttributeError: 'ForeignKeyField' object has no attribute 'id'
```

But I am able to query like this:

```
    In [7]: menu = MenuItem.select().first()
    
    In [8]: menu.restaurant.id
    Out[8]: 1
    
    In [9]: menu.restaurant.name
    Out[9]: u'Pizza Palace'
```

Same problem I am getting while:
```
menu = MenuItem.select().where(MenuItem.restaurant.name == 'Veggie Burger').first()
```
Here I am not getting error but I am getting zero output from the query even though I have rows for that query in db.