From d118c30a455cce587e126e94771b0967ec311532 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 6 Aug 2011 09:41:42 +0200 Subject: [PATCH] more cast migration --- pandora/item/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 11ffa38b..2dd8450b 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -490,9 +490,10 @@ class Item(models.Model): if key == 'character': values = self.get('cast', '') if values: - if isinstance(values[0], basestring): - values = [values[0], ] - else: + if isinstance(values[0], basestring): + values = [values] + if isinstance(values[0], list): + values = map(lambda x: {'actor': x[0], 'character': x[1]}, values) values = [i['character'] for i in values] else: values = self.get(key, '')