From 3c779162310ab4c65bee9ec57f9c77c51f4eaca9 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 29 Sep 2012 19:00:54 +0200 Subject: [PATCH] support lists..sort as key, fixes #1046 --- pandora/user/models.py | 3 +++ pandora/user/views.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora/user/models.py b/pandora/user/models.py index 1a0393977..3d05b151c 100644 --- a/pandora/user/models.py +++ b/pandora/user/models.py @@ -172,6 +172,9 @@ class UserProfile(models.Model): notes = models.TextField(default='') + def __unicode__(self): + return self.user.username + def get_ui(self): return get_ui(self.ui, self.user) diff --git a/pandora/user/views.py b/pandora/user/views.py index cd8c32b17..645600fc6 100644 --- a/pandora/user/views.py +++ b/pandora/user/views.py @@ -777,7 +777,7 @@ def setUI(request): else: ui = json.loads(request.session.get('ui', '{}')) for key in data: - keys = re.sub('([^\\\\])\.', '\\1\n', key).split('\n') + keys = map(lambda p: p.replace('\0', '\\.'), key.replace('\\.', '\0').split('.')) value = data[key] p = ui while len(keys)>1: