Many to many creation results in AttributeError
This is definitely not the ideal scenario, but it fixed my errors so I can continue development... 

cc @coleifer  Actually this breaks other functionality... so disregard. 

Had to do this instead:

```python
db.execute_sql("""
    INSERT INTO account_board (account_id, board_id)
    VALUES (%s, %s)
""", (session["id"], b.id))
``` You're calling Board.create().execute() which is weird... Sorry, I deleted my previous comment, because it's actually not technically necessary to use the "_id" accessor when passing in the plain old integer foreign key ID (instead of a related model instance).

I'm having trouble with your example -- it doesn't make sense, is that from your actual code or is it something you made up for the ticket?

`Board.create(**kwargs).execute()` doesn't make any sense. I see that part of the issue is related to having PRIMARY KEY=False. Why not make a composite key on both fields instead?

```
primary_key = CompositeKey('account', 'board')
```

Or does that just cause more issues for you? Let me try making a composite key. I'm using Postgres and it doesn't
support composite keys but it does support adding a unique index with two
or more columns.

I didn't mean to put `Board.create`, I meant to put `Board.insert`. Also
the code is copy/pasted. I'll try your suggestions and get back to you.
Thanks for your help. @coleifer i modified my code in my OP to reflect your changes. I'm now getting this error:

```
peewee.ProgrammingError: column "id" does not exist
LINE 1: ...rd" ("account_id", "board_id") VALUES (2, 79) RETURNING "id"
```

 Disregard, I got it to work :) thanks @coleifer, I just needed to know about the `CompositeKey` class
Getting an attribute error when saving a model with two foreign key relationships.

```python
class Account(BaseModel):
    created_on = DateTimeField(null=False)
    username = CharField(null=False, unique=True)
    password = CharField(null=False)
    salt = CharField(null=False)
    name = CharField(null=False)
    last_session_on = DateTimeField()

class Board(BaseModel):
    name = CharField()
    created_on = DateTimeField(null=False)
    slug = CharField(null=False)

class AccountBoard(BaseModel):
    account = ForeignKeyField(Account, null=False, unique=True)
    board = ForeignKeyField(Board, null=False, unique=True)

    primary_key = CompositeKey('account', 'board')

    class Meta:
        db_table = "account_board"

kwargs = {"name": model.get("name")}

# App crashes here. board.id and session["id"] are returning integers
with db.atomic():
    board = Board.create(**kwargs)
    AccountBoard.create(board=board, account=session["id"])
```

```
builtins.AttributeError
AttributeError: 'bool' object has no attribute 'as_entity'
```

Can anyone point me in the right direction? I really don't understand what's wrong about this code.