I am using SQLAlchemy and I want to insert a record into the database. I am running my application in Flask-Restful
model.py
class User(BaseModel, db.Model): """Model for the user table""" __tablename__ = 'usertable' email = db.Column(db.String(120), nullable=False) password = db.Column(db.String(200), nullable=False) signup.py
from app.models import db, User class Register(Resource): def post(self): email = request.json['email'] password = request.json['password'] db.session.add(User.email = '[email protected]') // Here, I am not sure return email I want to add email and password into the table usertable . When I am running the code, error is showing, SyntaxError: keyword can't be an expression . What is the recommended way to add a record in SQLAlchemy ?