I’m using React, Flask, and SQLAlchemy to maintain a database of Cars.
As part of my application, I’d like for each user to create a Car and then only be linked to that one Car (obviously in the real world this might not be the case but just for the purposes of this case). Is there a way to do this? Perhaps extracting the user’s information and then creating a new User model instance based on that information? Or something along those lines…
As an example, my Cars model looks like:
class Cars(db.Model): __tablename__ = 'cars' id = db.Column(db.Integer, primary_key=True) manufacturer = db.Column(db.String(30)) model = db.Column(db.String(30)) reg_no = db.Column(db.String(10))