Added a entry for viewing active API keys

This commit is contained in:
2011-08-31 11:04:35 +01:00
parent 3ed482d329
commit 781ca18db0
2 changed files with 6 additions and 0 deletions

View File

@@ -40,6 +40,11 @@ class EVEPlayerCorporation(EVEAPIModel):
""" Returns the number of characters with stored API keys """
return self.eveplayercharacter_set.filter(eveaccount__isnull=False).count()
@property
def active_api_keys(self):
""" Returns the number of characters with stored and active API keys """
return self.eveplayercharacter_set.filter(eveaccount__isnull=False, eveaccount__api_status=API_STATUS_OK).count()
@property
def director_api_keys(self):
return self.directors.filter(eveaccount__isnull=False, eveaccount__api_keytype=API_KEYTYPE_FULL, eveaccount__api_status=API_STATUS_OK)