diff --git a/analyzer/models.py b/analyzer/models.py index 85d7a24..490495a 100755 --- a/analyzer/models.py +++ b/analyzer/models.py @@ -33,6 +33,8 @@ class Deck(models.Model): return self.name def get_cards(self): return self.included_set.all().order_by('card__type__name') + def card_count(self): + return sum([i.count for i in self.included_set.all()]) def lands(self): symbols = {} for symbol in mtg.Mana.types.keys(): diff --git a/templates/decks/detail.html b/templates/decks/detail.html index 8c33207..6439456 100755 --- a/templates/decks/detail.html +++ b/templates/decks/detail.html @@ -48,7 +48,7 @@
-

Cards

+

Cards [{{ deck.card_count }}]

{% regroup deck.get_cards by card.type as cards %}