X-Git-Url: https://git.sommitrealweird.co.uk/sommitrealweird.git/blobdiff_plain/ade662a8e015bcecdc58512f915e4f56d16a56ed..HEAD:/sommitrealweird/bpcms/context_processors.py?ds=inline diff --git a/sommitrealweird/bpcms/context_processors.py b/sommitrealweird/bpcms/context_processors.py index bf0b8f2..e92e8ce 100644 --- a/sommitrealweird/bpcms/context_processors.py +++ b/sommitrealweird/bpcms/context_processors.py @@ -4,6 +4,7 @@ from django.core.cache import cache import re def content_menu(request): + menu_items = cache.get('bpcms_mainmenu') if not menu_items: @@ -32,7 +33,7 @@ def content_menu(request): pass menu_items.sort( \ - cmp=lambda x,y: cmp(x['title'].lower(), y['title'].lower())) + key=lambda x: x['title'].lower()) cache.set('bpcms_mainmenu', menu_items, 3600) return { @@ -86,7 +87,7 @@ def content_submenu(request): ) menu_items.sort( \ - cmp=lambda x,y: cmp(x['title'].lower(), y['title'].lower())) + key=lambda x: x['title'].lower()) cache.set('bpcms_contentmenu_%s' %("/".join(folderpath)), menu_items)