Created
April 18, 2016 19:49
-
-
Save jaredlockhart/13a18cd7b95da192e837d572c6862e57 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @staticmethod | |
| def get_matches_for_hero_id(hero_id): | |
| return (Match.objects | |
| .filter(playerinmatch__hero__pk=hero_id, valid_for_model=True) | |
| .order_by('-match_id') | |
| .prefetch_related( | |
| 'playerinmatch', | |
| 'playerinmatch__hero', | |
| 'playerinmatch__hero', | |
| 'playerinmatch__item_0', | |
| 'playerinmatch__item_1', | |
| 'playerinmatch__item_2', | |
| 'playerinmatch__item_3', | |
| 'playerinmatch__item_4', | |
| 'playerinmatch__item_5', | |
| )) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment