Commit f62514eb authored by echel0n's avatar echel0n

Refactored lazy loading for relationships on database models to joined.

parent ac67fde4
......@@ -75,8 +75,8 @@ class MainDB(SRDatabase):
last_backlog_search = Column(Integer,
last_proper_search = Column(Integer,
episodes = relationship('TVEpisode', uselist=True, backref='tv_shows', lazy='dynamic')
imdb_info = relationship('IMDbInfo', uselist=False, backref='tv_shows')
episodes = relationship('TVEpisode', uselist=True, backref='tv_shows', lazy='joined')
imdb_info = relationship('IMDbInfo', uselist=False, backref='tv_shows', lazy='joined')
class TVEpisode(MainDBBase):
__tablename__ = 'tv_episodes'
......@@ -114,7 +114,7 @@ class MainDB(SRDatabase):
version = Column(Integer, default=-1)
release_group = Column(Text, default='')
show = relationship('TVShow', uselist=False, backref='tv_episodes')
show = relationship('TVShow', uselist=False, backref='tv_episodes', lazy='joined')
class IMDbInfo(MainDBBase):
__tablename__ = 'imdb_info'
Markdown is supported
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