From 3cdd52912e683d05ec688ebdd84af8d7d55f8805 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 5 Sep 2010 23:07:41 +0200 Subject: [PATCH] return some ui settings for logged in users --- pandora/oxuser/models.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pandora/oxuser/models.py b/pandora/oxuser/models.py index c76af92e..a7f5a5cf 100644 --- a/pandora/oxuser/models.py +++ b/pandora/oxuser/models.py @@ -37,8 +37,30 @@ def getUserJSON(user): elif user.has_perm('0x.vip'): #FIXME: permissions json['group'] = 'vip' json['preferences'] = getPreferences(user) + json['ui'] = getUI(user) return json +def getUI(user): + return { + "columns": ["id", "title", "director", "country", "year", "language", "genre"], + "findQuery": {"conditions": [{"key": "", "value": "", "operator": ""}], "operator": ""}, + "groupsQuery": {"conditions": [], "operator": "|"}, + "groupsSize": 128, + "itemView": "info", + "listQuery": {"conditions": [], "operator": ""}, + "listsSize": 192, + "listView": "list", + "sections": ["history", "lists", "public", "featured"], + "showGroups": True, + "showInfo": True, + "showLists": True, + "showMovies": True, + "sort": [ + {"key": "director", "operator": ""} + ], + "theme": "classic" + } + def getPreferences(user): prefs = {} for p in Preference.objects.filter(user=user):