Show if a account is not training on the character list

This commit is contained in:
2011-05-31 12:37:02 +01:00
parent b11cc15c0b
commit 74735edbdc
2 changed files with 5 additions and 1 deletions

View File

@@ -33,6 +33,10 @@ class EVEAccount(EVEAPIModel):
def in_corp(self, corpid): def in_corp(self, corpid):
return self.character.filter(corporation__id=corpid).count() return self.character.filter(corporation__id=corpid).count()
@property
def training(self):
return self.characters.filter(eveplayercharacterskill__in_training__gt=0).count()
class Meta: class Meta:
app_label = 'eve_api' app_label = 'eve_api'
verbose_name = 'EVE Account' verbose_name = 'EVE Account'

View File

@@ -11,7 +11,7 @@
<table> <table>
<tr><th>Character Name</th><th>Corporation</th><th>Alliance</th><th>Skillpoints</th><th>Training</th></tr> <tr><th>Character Name</th><th>Corporation</th><th>Alliance</th><th>Skillpoints</th><th>Training</th></tr>
{% for acc in acc_list %} {% for acc in acc_list %}
<tr><th colspan=5>Account {{ acc.grouper }}</th></tr> <tr><th colspan=5>Account {{ acc.grouper }} {% if acc.grouper.training == 0 %}<font color="#F87217">(No Character Training)</font>{% endif %}</th></tr>
{% for char in acc.list %} {% for char in acc.list %}
<tr><td><a href="{% url eveapi-character char.id %}">{{ char.name }}</a></td> <tr><td><a href="{% url eveapi-character char.id %}">{{ char.name }}</a></td>
<td><a href="{% url eveapi-corporation char.corporation.id %}">{{ char.corporation }}</a></td> <td><a href="{% url eveapi-corporation char.corporation.id %}">{{ char.corporation }}</a></td>