UnboundLocalError: local variable 'constructor' referenced before assignment
When calling `switch()` you need to pass the model you are switching the context to. The error message is not very helpful, but you should change your code in this manner:

```python
.join(User).switch(PlatformBridge).join(Bot)
``` I've also amended the implementation of `switch()` so that when called with no parameters it will default to switching to the query's model. Ok, thank you for the quick response!
This error occurs on Peewee 3.1.1, after an upgrade from Peewee 2.9.3.

Here is quick script that reproduces the error:
```import peewee

class Bot(BaseModel):
    name = peewee.CharField(max_length=30, index=True)

class User(BaseModel):
    original_id = peewee.CharField(max_length=50, null=True)

class PlatformBridge(BaseModel):
    bot = peewee.ForeignKeyField(Bot, backref='platform_bridges')
    user = peewee.ForeignKeyField(User, backref='platform_bridges')

PlatformBridge.select(PlatformBridge, User, Bot).join(User).switch().join(Bot)
```

with `BaseModel` being a base class where the db connection is configured.

The stacktrace:
```
Traceback (most recent call last):
  File "test.py", line 14, in <module>
    PlatformBridge.select(PlatformBridge, User, Bot).join(User).switch().join(Bot)
  File "/opt/likeabot/virtualenv/lib/python3.5/site-packages/peewee.py", line 569, in inner
    method(clone, *args, **kwargs)
  File "/opt/likeabot/virtualenv/lib/python3.5/site-packages/peewee.py", line 5634, in join
    on, attr, constructor = self._normalize_join(src, dest, on, attr)
  File "/opt/likeabot/virtualenv/lib/python3.5/site-packages/peewee.py", line 5628, in _normalize_join
    return (on, attr, constructor)
UnboundLocalError: local variable 'constructor' referenced before assignment
```

on Python 3.5.2.