From a214d4ec7c37b48a837a6a40150c29aea0d03bee Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 10 Mar 2012 18:29:46 +0100 Subject: [PATCH] better unicode representation of items --- pandora/item/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index c7c6af19..e8515977 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -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