mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Role object now returns its name or ID
This commit is contained in:
@@ -114,6 +114,15 @@ class EVEPlayerCharacterRole(EVEAPIModel):
|
||||
roleid = models.CharField(max_length=64, blank=False, null=False)
|
||||
name = models.CharField(max_length=255, blank=False, null=False)
|
||||
|
||||
def __unicode__(self):
|
||||
if self.name:
|
||||
return self.name
|
||||
else:
|
||||
return self.id
|
||||
|
||||
def __str__(self):
|
||||
return self.__unicode__()
|
||||
|
||||
class Meta:
|
||||
app_label = 'eve_api'
|
||||
verbose_name = 'Player Role'
|
||||
|
||||
Reference in New Issue
Block a user