Commit cfd503cb authored by Christopher Bohn's avatar Christopher Bohn 🤔
Browse files

Corrected updated relationships

parent 4043d37f
......@@ -13,7 +13,7 @@ class Movie(Persisted):
budget = Column(Integer)
gross_revenue = Column(Integer)
opening_date = Column(Date)
genres = relationship('Genre', uselist=True, secondary='movie_genres', viewonly=True)
genres = relationship('Genre', uselist=True, secondary='movie_genres', back_populates='movies')
reviews = relationship('Review', uselist=True, back_populates='movie')
......@@ -30,7 +30,7 @@ class Genre(Persisted):
__tablename__ = 'genres'
genre_id = Column(Integer, primary_key=True)
name = Column(String(256), nullable=False)
movies = relationship('Movie', uselist=True, secondary='movie_genres', viewonly=True)
movies = relationship('Movie', uselist=True, secondary='movie_genres', back_populates='genres')
class MovieGenre(Persisted):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment