I have an ORM class created with SQLAlchemy, example:
class Person(Base):
name = Column(String,nullable=False)
birthdate = Column(String,CheckConstraint("birthdate >= '1970-01-01'")
ssn = Column(String,primary_key=True)
My Flask app will be in charge of retrieving and inserting ORM objects like so:
@app.route("/people/<ssn>/insert",methods=["PUT"])
def insert_person(ssn):
# insert person into database
The information to be inserted will be provided within the request, via a JSON string, ex:
{"name":"Bobby Burger","ssn":"123-45-6789"}
I already have a schema defined that I won't mention here.
I want to create an ORM object filled with the information provided.
How do I do this?
I have an ORM class created with SQLAlchemy, example:
My Flask app will be in charge of retrieving and inserting ORM objects like so:
The information to be inserted will be provided within the request, via a JSON string, ex:
{"name":"Bobby Burger","ssn":"123-45-6789"}I already have a schema defined that I won't mention here.
I want to create an ORM object filled with the information provided.
How do I do this?