From 3447bd40e2ff1cdcf000a9799a118f34e9427041 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 21 Jan 2011 17:35:43 +0530 Subject: [PATCH] add __unicode__ --- pandora/item/models.py | 1 + pandora/urlalias/models.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/pandora/item/models.py b/pandora/item/models.py index 2d1fdb1..53aafcb 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -292,6 +292,7 @@ class Item(models.Model): if local_posters: posters['local'] = [] for p in local_posters: + #FIXME: media_url is no longer public url = p.replace(settings.MEDIA_ROOT, settings.MEDIA_URL) width = 640 height = 1024 diff --git a/pandora/urlalias/models.py b/pandora/urlalias/models.py index 38772ee..5cd491f 100644 --- a/pandora/urlalias/models.py +++ b/pandora/urlalias/models.py @@ -5,11 +5,20 @@ class IDAlias(models.Model): old = models.CharField(max_length=255, unique=True) new = models.CharField(max_length=255) + def __unicode__(self): + return u"%s=%s" % (self.old, self.new) + class LayerAlias(models.Model): old = models.CharField(max_length=255, unique=True) new = models.CharField(max_length=255) + def __unicode__(self): + return u"%s=%s" % (self.old, self.new) + class Alias(models.Model): url = models.CharField(max_length=255, unique=True) target = models.CharField(max_length=255) + def __unicode__(self): + return u"%s=%s" % (self.url, self.target) +