forked from 0x2620/pandora
better unicode representation of items
This commit is contained in:
parent
931aeaf130
commit
a214d4ec7c
1 changed files with 4 additions and 2 deletions
|
@ -290,8 +290,10 @@ class Item(models.Model):
|
|||
def __unicode__(self):
|
||||
year = self.get('year')
|
||||
if year:
|
||||
return u'%s (%s)' % (self.get('title', 'Untitled'), self.get('year'))
|
||||
return self.get('title', u'Untitled')
|
||||
string = u'%s (%s)' % (self.get('title', 'Untitled'), self.get('year'))
|
||||
else:
|
||||
string = self.get('title', u'Untitled')
|
||||
return u'[%s] %s' % (self.itemId,string)
|
||||
|
||||
def get_absolute_url(self):
|
||||
return '/%s' % self.itemId
|
||||
|
|
Loading…
Reference in a new issue