better unicode representation of items

This commit is contained in:
j 2012-03-10 18:29:46 +01:00
parent 931aeaf130
commit a214d4ec7c

View file

@ -290,8 +290,10 @@ class Item(models.Model):
def __unicode__(self): def __unicode__(self):
year = self.get('year') year = self.get('year')
if year: if year:
return u'%s (%s)' % (self.get('title', 'Untitled'), self.get('year')) string = u'%s (%s)' % (self.get('title', 'Untitled'), self.get('year'))
return self.get('title', u'Untitled') else:
string = self.get('title', u'Untitled')
return u'[%s] %s' % (self.itemId,string)
def get_absolute_url(self): def get_absolute_url(self):
return '/%s' % self.itemId return '/%s' % self.itemId