trophies: Reduce number of trophies fetched in Trophy.by_award.

We usually only care about 1 trophy anyway (except on admin pages) so
this is drastically wasteful.
This commit is contained in:
Neil Williams
2012-09-12 13:59:23 -07:00
parent 8b85deb45b
commit 5d6abdcf3b

View File

@@ -169,7 +169,7 @@ class Trophy(Relation(Account, Award)):
def by_award_cache(cls, award_id):
q = Trophy._query(Trophy.c._thing2_id == award_id,
sort = desc('_date'))
q._limit = 500
q._limit = 50
return [ t._id for t in q ]
@classmethod