mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Added permalinks for chars/corp models
This commit is contained in:
@@ -74,6 +74,10 @@ class EVEPlayerCharacter(EVEAPIModel):
|
||||
return self.eveaccount_set.all()[0]
|
||||
return None
|
||||
|
||||
@models.permalink
|
||||
def get_absolute_url(self):
|
||||
return ('eveapi-character', [self.pk])
|
||||
|
||||
def __unicode__(self):
|
||||
if self.name:
|
||||
return self.name
|
||||
|
||||
@@ -29,14 +29,18 @@ class EVEPlayerCorporation(EVEAPIModel):
|
||||
|
||||
group = models.ForeignKey(Group, blank=True, null=True)
|
||||
|
||||
@models.permalink
|
||||
def get_absolute_url(self):
|
||||
return ('eveapi-corporation', [self.pk])
|
||||
|
||||
class Meta:
|
||||
app_label = 'eve_api'
|
||||
verbose_name = 'Player Corporation'
|
||||
verbose_name_plural = 'Player Corporations'
|
||||
|
||||
def __str__(self):
|
||||
def __unicode__(self):
|
||||
if self.name:
|
||||
return self.name
|
||||
else:
|
||||
return "Corp #%d" % self.id
|
||||
return u"Corp #%d" % self.id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user