How to set primary key auto increment in SqlAlchemy orm
Clash Royale CLAN TAG #URR8PPP How to set primary key auto increment in SqlAlchemy orm I tired to use the SqlAlchemy orm to build the api to insert the values into database from uploaded excel files. when I tested on the codes it kept showing the error: TypeError: __init__() missing 1 required positional argument: 'id' I've updated the id key to primary key, auto increment, unique and unsigned in my local MySql data base. I believe the system cannot insert the primary key automatically because it works if I assign the value to id manually transaction_obj = Transaction(id=1, name="David", date="2018-03-03", product="fruit", quantity=20, amount=12.55) Here is model.py from sqlalchemy import Table, MetaData, Column, Integer, String, DATE, DECIMAL,ForeignKey, DateTime from sqlalchemy.orm import mapper metadata = MetaData() customers = Table('customers', metadata, Column('id', Integer, primary_key=True), Column('name',...