mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-13 22:32:15 +00:00
Store the current training skill of the character
This commit is contained in:
@@ -53,6 +53,7 @@ class EVEPlayerCharacterSkill(models.Model):
|
|||||||
skill = models.ForeignKey('eve_api.EVESkill')
|
skill = models.ForeignKey('eve_api.EVESkill')
|
||||||
level = models.IntegerField(default=0)
|
level = models.IntegerField(default=0)
|
||||||
skillpoints = models.IntegerField(default=0)
|
skillpoints = models.IntegerField(default=0)
|
||||||
|
in_training = models.IntegerField(default=0)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return u"%s - Level %s" % (self.skill, self.level)
|
return u"%s - Level %s" % (self.skill, self.level)
|
||||||
|
|||||||
@@ -124,6 +124,19 @@ def import_eve_character_func(character_id, api_key=None, user_id=None, logger=l
|
|||||||
charskillobj.save()
|
charskillobj.save()
|
||||||
pchar.total_sp = pchar.total_sp + int(skill['skillpoints'])
|
pchar.total_sp = pchar.total_sp + int(skill['skillpoints'])
|
||||||
|
|
||||||
|
try:
|
||||||
|
skillqueue = CachedDocument.objects.api_query('/char/SkillInTraining.xml.aspx', params=auth_params, no_cache=False)
|
||||||
|
except DocumentRetrievalError, exc:
|
||||||
|
logger.error('Error retrieving SkillInTraining.xml.aspx for User ID %s, Character ID %s - %s' % (user_id, character_id, exc))
|
||||||
|
else:
|
||||||
|
queuedoc = basic_xml_parse_doc(skillqueue)['eveapi']['result']
|
||||||
|
EVEPlayerCharacterSkill.objects.filter(character=pchar).update(in_training=0)
|
||||||
|
if int(queuedoc['skillInTraining']):
|
||||||
|
skillobj, created = EVESkill.objects.get_or_create(id=skill['trainingTypeID'])
|
||||||
|
charskillobj = EVEPlayerCharacterSkill.objects.get_or_create(skill=skillobj, character=pchar)
|
||||||
|
charskillobj.in_training = queuedoc['trainingToLevel']
|
||||||
|
charskillobj.save()
|
||||||
|
|
||||||
# Process the character's roles
|
# Process the character's roles
|
||||||
pchar.director = False
|
pchar.director = False
|
||||||
pchar.roles.clear()
|
pchar.roles.clear()
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ table th a:visted
|
|||||||
.character_info .character_corporation span, .character_info .character_alliance span { font-weight: bold; display: block; text-align: center; }
|
.character_info .character_corporation span, .character_info .character_alliance span { font-weight: bold; display: block; text-align: center; }
|
||||||
.character_info .character_attributes ul { margin: .25em 2em; padding: 0; }
|
.character_info .character_attributes ul { margin: .25em 2em; padding: 0; }
|
||||||
.character_info .character_skills table { width: 100%; }
|
.character_info .character_skills table { width: 100%; }
|
||||||
|
.character_info .character_skills .intraining { background-color: #cc6600; }
|
||||||
.character_info .character_stats table { width: 300px; }
|
.character_info .character_stats table { width: 300px; }
|
||||||
.character_info .character_attributes .stat { font-weight: bold; }
|
.character_info .character_attributes .stat { font-weight: bold; }
|
||||||
.character_skills th { cursor:pointer;cursor:hand; }
|
.character_skills th { cursor:pointer;cursor:hand; }
|
||||||
|
|||||||
Reference in New Issue
Block a user