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):
|
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
|
||||||
|
|
Loading…
Reference in a new issue