How about:
> -1 this is nonsense. It's perfectly legal to have two columns with primary_key=True in an SQLAlchemy model (although as @ChrisJohnson notes, this creates a compound primary key, not "two primary keys") and that was not the cause of the error here. – Mark Amery Apr 15 at 14:10