I\'m trying to create a one-to-one relationship in Flask using SqlAlchemy. I followed this previous post and I created the classes like ones below:
class Im
Try out this
enter code here
class Image(db.Model):
__tablename__ = 'image'
image_id = db.Column(db.Integer, primary_key = True)
name = db.Column(db.String(8))
class Blindmap(db.Model):
__tablename__ = 'blindmap'
module_id = db.Column(db.Integer, primary_key = True)
image_id = db.Column(db.Integer, ForeignKey('image.image_id'),unique=True)