Answer the question
In order to leave comments, you need to log in
How to write all data of a Flask model to a field of another model?
There is a Movie model with id, rating, comment and name fields.
class Movie(Base):
__tablename__ = "movie's"
id = Column(Integer, primary_key = True)
name = Column(String(255))
rating = Column(Float)
comment = Column(sqlalchemy_jsonfield.JSONField(
enforce_string=True,
enforce_unicode=False,
json=ujson,
))
class Comment(Base):
__tablename__ = "comments"
id = Column(Integer, primary_key = True)
commentator_name = Column(String(50)
/and another field/
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question