Skip to content

Commit

Permalink
models: Use dynamic lazy loading for User.{comments,updates}
Browse files Browse the repository at this point in the history
This should hopefully address some of the memory/CPU/db issues discussed in
issue #301
  • Loading branch information
lmacken committed Oct 1, 2015
1 parent 65f319c commit 7f5e89a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bodhi/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2002,8 +2002,8 @@ class User(Base):
email = Column(UnicodeText, unique=True)

# One-to-many relationships
comments = relationship(Comment, backref=backref('user', lazy=True))
updates = relationship(Update, backref=backref('user', lazy=True))
comments = relationship(Comment, backref=backref('user'), lazy='dynamic')
updates = relationship(Update, backref=backref('user'), lazy='dynamic')

# Many-to-many relationships
groups = relationship("Group", secondary=user_group_table, backref='users')
Expand Down

0 comments on commit 7f5e89a

Please sign in to comment.