Display deck card count
This commit is contained in:
parent
bf75fa5535
commit
462e51bfdb
2 changed files with 3 additions and 1 deletions
|
@ -33,6 +33,8 @@ class Deck(models.Model):
|
||||||
return self.name
|
return self.name
|
||||||
def get_cards(self):
|
def get_cards(self):
|
||||||
return self.included_set.all().order_by('card__type__name')
|
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):
|
def lands(self):
|
||||||
symbols = {}
|
symbols = {}
|
||||||
for symbol in mtg.Mana.types.keys():
|
for symbol in mtg.Mana.types.keys():
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
<section class="cards">
|
<section class="cards">
|
||||||
<h3>Cards</h3>
|
<h3>Cards [{{ deck.card_count }}]</h3>
|
||||||
{% regroup deck.get_cards by card.type as cards %}
|
{% regroup deck.get_cards by card.type as cards %}
|
||||||
<ul>
|
<ul>
|
||||||
{% for group in cards %}
|
{% for group in cards %}
|
||||||
|
|
Loading…
Reference in a new issue